类 DozerUtil


  • public class DozerUtil
    extends Object
    Dozer工具类
    作者:
    youta
    • 字段详细资料

      • mapper

        private final com.github.dozermapper.core.Mapper mapper
    • 构造器详细资料

      • DozerUtil

        public DozerUtil​(com.github.dozermapper.core.Mapper mapper)
    • 方法详细资料

      • getMapper

        public com.github.dozermapper.core.Mapper getMapper()
      • map

        public <T> T map​(Object source,
                         Class<T> destinationClass)
        Constructs new instance of destinationClass and performs mapping between from source
        类型参数:
        T - T
        参数:
        source - source
        destinationClass - destinationClass
        返回:
        T
      • map2

        public <T> T map2​(Object source,
                          Class<T> destinationClass)
      • map

        public void map​(Object source,
                        Object destination)
        Performs mapping between source and destination objects
        参数:
        source - source object
        destination - destination object
      • map

        public <T> T map​(Object source,
                         Class<T> destinationClass,
                         String mapId)
        Constructs new instance of destinationClass and performs mapping between from source
        类型参数:
        T - T
        参数:
        source - source object
        destinationClass - destination class
        mapId - mapId
        返回:
        T
      • map

        public void map​(Object source,
                        Object destination,
                        String mapId)
        Performs mapping between source and destination objects
        参数:
        source - source object
        destination - destination object
        mapId - mapId
      • mapList

        public <T,​E> List<T> mapList​(Collection<E> sourceList,
                                           Class<T> destinationClass)
        将集合转成集合
        类型参数:
        T - T
        参数:
        sourceList - 源集合
        destinationClass - 待转类型
        返回:
        T
      • mapPage

        public <T,​E> List<T> mapPage​(Collection<E> sourceList,
                                           Class<T> destinationClass)
      • mapSet

        public <T,​E> Set<T> mapSet​(Collection<E> sourceList,
                                         Class<T> destinationClass)