Package com.expediagroup.beans.populator
Class PopulatorFactory
java.lang.Object
com.expediagroup.beans.populator.PopulatorFactory
public final class PopulatorFactory
extends java.lang.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> java.util.Optional<Populator>
getPopulator(java.lang.Class<O> destObjectClass, java.lang.Class<T> sourceObjectClass, BeanTransformer transformer)
Creates an instance of the populator object based on the given class.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
PopulatorFactory
public PopulatorFactory()
-
-
Method Details
-
getPopulator
public static <O, T> java.util.Optional<Populator> getPopulator(java.lang.Class<O> destObjectClass, java.lang.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
-