Class MapTransformation


  • public class MapTransformation
    extends ReassignTransformation
    The map transformation is the simplest mapping operation. It just reassigns a field from the source object to a destination object while the property name AND [ types are equal OR a matching mapper is registered on the parent mapper ]. Therefore the mapping transformation is a special case of ReassignTransformation. This mapping transformation is only used internally to distinguish from mappings configured by the user and implicit field mappings created by the mapper itself.
    • Method Detail

      • toString

        public String toString()
      • getDestinationPropertyName

        public String getDestinationPropertyName()
        Returns:
        Returns the destination property name.
      • getSourcePropertyName

        public String getSourcePropertyName()
        Returns:
        Returns the source property name. This might be a property path, if the transformation operates on property paths like PropertyPathTransformation.
      • getDestinationType

        protected Class<?> getDestinationType()
      • getSourceType

        protected Class<?> getSourceType()
      • performTransformation

        public void performTransformation​(Object source,
                                          Object destination)
                                   throws MappingException
        Performs the transformation for the specified source and destination.
        Parameters:
        source - The source object
        destination - The destination object.
        Throws:
        MappingException - Thrown on any transformation error.
      • hasMapperFor

        public <S,​T> boolean hasMapperFor​(Class<S> sourceType,
                                                Class<T> destinationType)
        Checks if the specified mapper is registered.
        Parameters:
        sourceType - The source type
        destinationType - the destination type
        Returns:
        Returns true if a mapper was registered for this type of conversion. Otherwise false is returned.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object