org.mapstruct.factory

Class Mappers



  • public class Mappersextends Object
    Factory for obtaining mapper instances if no explicit component model such as CDI is configured via Mapper.componentModel().

    Mapper implementation types are expected to have the same fully qualified name as their interface type, with the suffix Impl appended. When using this factory, mapper types - and any mappers they use - are instantiated by invoking their public no-args constructor.

    By convention, a single instance of each mapper is retrieved from the factory and exposed on the mapper interface type by declaring a member named INSTANCE like this:

     @Mapper public interface CustomerMapper {     CustomerMapper INSTANCE = Mappers.getMapper( CustomerMapper.class );     // mapping methods... } 

    Author:
    Gunnar Morling
    • Method Detail

      • getMapper

        public static <T> T getMapper(Class<T> clazz)
        Returns an instance of the given mapper type.
        Type Parameters:
        T - The type of the mapper to create.
        Parameters:
        clazz - The type of the mapper to return.
        Returns:
        An instance of the given mapper type.

Copyright © 2012–2015. All rights reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14