Interface ObjectFactory.ObjectFactoryInstance
-
- Enclosing interface:
- ObjectFactory
public static interface ObjectFactory.ObjectFactoryInstance
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description <T> Tcreate(Class<T> parentType)ObjectFactory.ObjectFactoryInstanceignoreUnknownProperties()If called the unsupported properties will be ignored otherwisecreate(Class)will fail with an exception.ObjectFactory.ObjectFactoryInstancewithFieldInjection()Set that the properties can be injected into fields directly, default uses fields but not private ones.ObjectFactory.ObjectFactoryInstancewithoutFieldInjection()Set that the properties can NOT be injected into fields directly.ObjectFactory.ObjectFactoryInstancewithProperties(Map<String,?> properties)default <T> ObjectFactory.ObjectFactoryInstancewithProperties(Stream<T> stream, Function<T,String> keyExtractor, Function<T,?> valueExtractor)Shortcut forwithProperties(Map).
-
-
-
Method Detail
-
withFieldInjection
ObjectFactory.ObjectFactoryInstance withFieldInjection()
Set that the properties can be injected into fields directly, default uses fields but not private ones.- Returns:
- this.
-
withoutFieldInjection
ObjectFactory.ObjectFactoryInstance withoutFieldInjection()
Set that the properties can NOT be injected into fields directly.- Returns:
- this.
-
ignoreUnknownProperties
ObjectFactory.ObjectFactoryInstance ignoreUnknownProperties()
If called the unsupported properties will be ignored otherwisecreate(Class)will fail with an exception.- Returns:
- this.
-
withProperties
ObjectFactory.ObjectFactoryInstance withProperties(Map<String,?> properties)
- Parameters:
properties- the properties to use to configure the instance.- Returns:
- this.
-
withProperties
default <T> ObjectFactory.ObjectFactoryInstance withProperties(Stream<T> stream, Function<T,String> keyExtractor, Function<T,?> valueExtractor)
Shortcut forwithProperties(Map). Note that if there are conflicting keys the last one is used.- Type Parameters:
T- the type of the created object.- Parameters:
stream- a stream of properties.keyExtractor- how to extract the key from the incoming stream.valueExtractor- how to extract the value from the incoming stream.- Returns:
- this.
-
-