All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.hutool.core.bean.copier.AbsCopier Maven / Gradle / Ivy

Go to download

Hutool是一个小而全的Java工具类库,通过静态方法封装,降低相关API的学习成本,提高工作效率,使Java拥有函数式语言般的优雅,让Java语言也可以“甜甜的”。

There is a newer version: 5.8.34
Show newest version
package cn.hutool.core.bean.copier;

import cn.hutool.core.lang.copier.Copier;
import cn.hutool.core.util.ObjectUtil;

/**
 * 抽象的对象拷贝封装,提供来源对象、目标对象持有
 *
 * @param  来源对象类型
 * @param  目标对象类型
 * @author looly
 * @since 5.8.0
 */
public abstract class AbsCopier implements Copier {

	protected final S source;
	protected final T target;
	/**
	 * 拷贝选项
	 */
	protected final CopyOptions copyOptions;

	public AbsCopier(S source, T target, CopyOptions copyOptions) {
		this.source = source;
		this.target = target;
		this.copyOptions = ObjectUtil.defaultIfNull(copyOptions, CopyOptions::create);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy