Class ObjectMappie2

  • All Implemented Interfaces:

    
    public abstract class ObjectMappie2<FROM1 extends Object, FROM2 extends Object, TO extends Object>
     implements Mappie<TO>
                        

    Base class for object mappers. See the documentation for a complete overview of how to generate object mappers.

    For example

    class PersonMapper : ObjectMappie2<PersonDto, AddressDto, Person>() {
         override fun map(first: PersonDto, second: AddressDto) = mapping()
    }

    will generate a mapper from PersonDto and AddressDto to Person, assuming all dto's and Person have a resolvable mapping.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      ObjectMappie2()
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      TO map(FROM1 first, FROM2 second) Map first and second to an instance of TO.
      final TO mapNullable(FROM1 first, FROM2 second) Map nullable first and second to an instance of TO.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ObjectMappie2

        ObjectMappie2()
    • Method Detail

      • map

         TO map(FROM1 first, FROM2 second)

        Map first and second to an instance of TO.

        Parameters:
        first - the first source value.
        second - the second source value.
        Returns:

        first and second mapped to an instance of TO.

      • mapNullable

         final TO mapNullable(FROM1 first, FROM2 second)

        Map nullable first and second to an instance of TO.

        Parameters:
        first - the first source value.
        second - the second source value.
        Returns:

        first and second mapped an instance of TO.