package vc.thinker.utils.dependhandle;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.function.Function;

/**
 * 外键与设置过程关系
 *
 * @author HeTongHao
 * @since 2021/1/6 13:57
 */
@Data
@AllArgsConstructor
public class KeyValueHandlerRelation<T, D, K> {
    public static <T, D, K> KeyValueHandlerRelation<T, D, K> of(Function<T, K> foreignKey
            , SetValueHandler<T, D> setValueHandler) {
        return new KeyValueHandlerRelation<>(foreignKey, setValueHandler);
    }

    private Function<T, K> foreignKey;
    private SetValueHandler<T, D> setValueHandler;
}