Package com.hotels.beans.populator
Class PopulatorFactory
java.lang.Object
com.hotels.beans.populator.PopulatorFactory
public final class PopulatorFactory extends Object
Creates a
Populator
instance for the given class.-
Constructor Summary
Constructors Constructor Description PopulatorFactory()
-
Method Summary
Modifier and Type Method Description static <O, T> Optional<Populator>
getPopulator(Class<O> destObjectClass, Class<T> sourceObjectClass, BeanTransformer transformer)
Creates an instance of the populator object based on the given class.
-
Constructor Details
-
PopulatorFactory
public PopulatorFactory()
-
-
Method Details
-
getPopulator
public static <O, T> Optional<Populator> getPopulator(Class<O> destObjectClass, Class<T> sourceObjectClass, BeanTransformer transformer)Creates an instance of the populator object based on the given class.- Type Parameters:
O
- the generic type of the contained object in the destination objectT
- the generic type of the contained object in the source object- Parameters:
destObjectClass
- the destination object classsourceObjectClass
- the source object classtransformer
- the bean transformer containing the field name mapping and transformation functions- Returns:
- the populator instance
-