
com.magictools.core.clone.DefaultCloneable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of magic-tools-core Show documentation
Show all versions of magic-tools-core Show documentation
magic-tools核心,包括集合、字符串、Bean等工具
The newest version!
package com.magictools.core.clone;
import com.magictools.core.util.ReflectUtil;
/**
* 克隆默认实现接口,用于实现返回指定泛型类型的克隆方法
*
* @param 泛型类型
* @since 5.7.17
*/
public interface DefaultCloneable extends java.lang.Cloneable {
/**
* 浅拷贝,提供默认的泛型返回值的clone方法。
*
* @return obj
*/
default T clone0() {
try {
return ReflectUtil.invoke(this, "clone");
} catch (Exception e) {
throw new CloneRuntimeException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy