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

com.jchanghong.core.lang.copier.SrcToDestCopier Maven / Gradle / Ivy

The newest version!
package com.jchanghong.core.lang.copier;

import java.io.Serializable;

import com.jchanghong.core.lang.Filter;

/**
 * 复制器抽象类
* 抽象复制器抽象了一个对象复制到另一个对象,通过实现{@link #copy()}方法实现复制逻辑。
* * @author Looly * * @param 拷贝的对象 * @param 本类的类型。用于set方法返回本对象,方便流式编程 * @since 3.0.9 */ public abstract class SrcToDestCopier> implements Copier, Serializable{ private static final long serialVersionUID = 1L; /** 源 */ protected T src; /** 目标 */ protected T dest; /** 拷贝过滤器,可以过滤掉不需要拷贝的源 */ protected Filter copyFilter; //-------------------------------------------------------------------------------------------------------- Getters and Setters start /** * 获取源 * @return 源 */ public T getSrc() { return src; } /** * 设置源 * * @param src 源 * @return this */ @SuppressWarnings("unchecked") public C setSrc(T src) { this.src = src; return (C)this; } /** * 获得目标 * * @return 目标 */ public T getDest() { return dest; } /** * 设置目标 * * @param dest 目标 * @return this */ @SuppressWarnings("unchecked") public C setDest(T dest) { this.dest = dest; return (C)this; } /** * 获得过滤器 * @return 过滤器 */ public Filter getCopyFilter() { return copyFilter; } /** * 设置过滤器 * * @param copyFilter 过滤器 * @return this */ @SuppressWarnings("unchecked") public C setCopyFilter(Filter copyFilter) { this.copyFilter = copyFilter; return (C)this; } //-------------------------------------------------------------------------------------------------------- Getters and Setters end }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy