接口 BeanUtilz


public interface BeanUtilz
Created by bean on 2020/1/3.
  • 方法详细资料

    • cloneWithFastjson

      static <T> T cloneWithFastjson(Object source, Type type)
    • copyFromObject

      static <T> T copyFromObject(Object source, T target)
      将source复制到target对象,并返回
      类型参数:
      T -
      参数:
      source -
      target -
      返回:
    • copyFromObject

      static <T> T copyFromObject(Object source, Class<T> type)
      将source复制到一个新的type类型对象,并返回
      类型参数:
      T -
      参数:
      source -
      type -
      返回:
    • copyFromList

      static <T> List<T> copyFromList(List<?> source, Class<T> type)
      将source集合复制到一个新的type类型的集合,并返回
      类型参数:
      T -
      参数:
      source -
      type -
      返回:
    • copyFromList

      static <T,​ S> List<T> copyFromList(List<S> source, Class<T> type, BeanUtilz.Function<T,​S> mapper)
      将source集合复制到一个新的type类型的集合,并返回,通知在复制的过程中可以通过mapper接口对复制结果进行二次处理
      类型参数:
      T -
      参数:
      source -
      type -
      mapper -
      返回:
    • diffList

      static <K,​ D> void diffList(List<D> list1, List<D> list2, Function<D,​K> key1, Function<D,​K> key2, BeanUtilz.DiffFunction<K,​D> insert, BeanUtilz.DiffFunction<K,​D> update, BeanUtilz.DiffFunction<K,​D> remove)