DataDaoKey.java 629 Bytes
package com.yanzuoguang.util.vo;

import com.yanzuoguang.util.base.ObjectHelper;

/**
 * 获取关键字
 *
 * @param <T>
 * @author 颜佐光
 */
public abstract class DataDaoKey<T> implements DataDaoKeyBase<T> {
    /**
     * 将当前对象的属性,写入到历史对象中,用于更新函数
     *
     * @param history
     * @param now
     */
    @Override
    public boolean set(T history, T now) {
        if (history == now) {
            return true;
        }
        if (history.equals(now)) {
            return false;
        }
        ObjectHelper.writeWithFrom(history, now);
        return true;
    }
}