Interface Mapper

  • All Known Implementing Classes:
    DozerBeanMapper, MappingProcessor

    public interface Mapper
    Public root interface for performing Dozer mappings from application code.
    • Method Detail

      • map

        <T> T map​(Object source,
                  Class<T> destinationClass)
           throws MappingException
        Constructs new instance of destinationClass and performs mapping between from source
        Type Parameters:
        T - type to convert to
        Parameters:
        source - object to convert from
        destinationClass - type to convert to
        Returns:
        mapped object
        Throws:
        MappingException - mapping failure
      • map

        void map​(Object source,
                 Object destination)
          throws MappingException
        Performs mapping between source and destination objects
        Parameters:
        source - object to convert from
        destination - object to convert to
        Throws:
        MappingException - mapping failure
      • map

        <T> T map​(Object source,
                  Class<T> destinationClass,
                  String mapId)
           throws MappingException
        Constructs new instance of destinationClass and performs mapping between from source
        Type Parameters:
        T - type to convert to
        Parameters:
        source - object to convert from
        destinationClass - type to convert to
        mapId - id in configuration for mapping
        Returns:
        mapped object
        Throws:
        MappingException - mapping failure
      • map

        void map​(Object source,
                 Object destination,
                 String mapId)
          throws MappingException
        Performs mapping between source and destination objects
        Parameters:
        source - object to convert from
        destination - object to convert to
        mapId - id in configuration for mapping
        Throws:
        MappingException - mapping failure
      • getMappingMetadata

        default MappingMetadata getMappingMetadata()
        The MappingMetadata interface can be used to query information about the current mapping definitions. It provides read only access to all important classes and field mapping properties. When first called, initializes all mappings if map() has not yet been called.
        Returns:
        An instance of MappingMetadata which serves starting point for querying mapping information.