Interface MapperRegistry

All Known Implementing Classes:
SimpleMapperRegistry

public interface MapperRegistry
Maps instances of one type to another. Originally implemented by Dozer, but now a generic interface due to the deprecation of Dozer.
  • Method Details

    • map

      default <SourceT, DestinationT> void map(SourceT source, DestinationT destination)
      Maps the source Object into the supplied destination Object, mutating the destination while preserving the source w/o modification.
      Parameters:
      source - the source object
      destination - the destination object
    • map

      default <SourceT, DestinationT> DestinationT map(SourceT source, Class<DestinationT> destinationClass)
      Maps instances of one type to another.
      Parameters:
      source - the source type
      destinationClass - the destination type
      Returns:
      the destination object
    • getMapper

      default <SourceT, DestinationT> MapperRegistry.Mapper<SourceT,DestinationT> getMapper(Class<SourceT> source, Class<DestinationT> destination)
      Gets a MapperRegistry.Mapper. Throwing MapperException in the event the mapping isn't found.
      Type Parameters:
      SourceT - the source type
      DestinationT - the destination type
      Parameters:
      source - the source type
      destination - the destination type
      Returns:
      the MapperRegistry.Mapper
    • findMapper

      <SourceT, DestinationT> Optional<MapperRegistry.Mapper<SourceT,DestinationT>> findMapper(Class<SourceT> source, Class<DestinationT> destination)
      Finds a MapperRegistry.Mapper. Throwing MapperException in the event the mapping isn't found.
      Type Parameters:
      SourceT - the source type
      DestinationT - the destination type
      Parameters:
      source - the source type
      destination - the destination type
      Returns:
      the MapperRegistry.Mapper
    • getUpdater

      default <SourceT, DestinationT> MapperRegistry.Updater<SourceT,DestinationT> getUpdater(Class<SourceT> source, Class<DestinationT> destination)
      Gets an MapperRegistry.Updater. Throwing MapperException in the event the mapping isn't found.
      Type Parameters:
      SourceT - the source type
      DestinationT - the destination type
      Parameters:
      source - the source type
      destination - the destination type
      Returns:
      the MapperRegistry.Mapper
    • findUpdater

      <SourceT, DestinationT> Optional<MapperRegistry.Updater<SourceT,DestinationT>> findUpdater(Class<SourceT> source, Class<DestinationT> destination)
      Finds an MapperRegistry.Updater. Throwing MapperException in the event the mapping isn't found.
      Type Parameters:
      SourceT - the source type
      DestinationT - the destination type
      Parameters:
      source - the source type
      destination - the destination type
      Returns:
      the MapperRegistry.Mapper