java.lang.Object
org.meeuw.configuration.Configuration
Immutable object containing all
ConfigurationAspects.- Since:
- 0.4
- Author:
- Michiel Meeuwissen
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Configuration.Builderbuilder()<E extends ConfigurationAspect>
EReturns the aspect with given class.<E extends ConfigurationAspect,V>
VgetAspectValue(Class<E> clazz, Function<E, V> getter) Gets a value of a certain configuration aspectgetConfigurationAspectsAssociatedWith(Class<?> clazz) <E extends ConfigurationAspect>
Configurationwith(Class<E> clazz, UnaryOperator<E> config)
-
Method Details
-
getAspect
Returns the aspect with given class.- Type Parameters:
E- the type of the configuration aspect- Parameters:
clazz- the class of the configuration aspect- Returns:
- the configuration aspect instance of that class currently configured in this configuration object
-
getAspectValue
Gets a value of a certain configuration aspect- Type Parameters:
E- the type of the configuration aspect- Parameters:
clazz- the class of the configuration aspectgetter- a function to get the value from the instance of the aspect (probably a method reference)- Returns:
- the request configuration aspect value
-
with
- Type Parameters:
E- the type of the class- Parameters:
clazz- The configuration aspect classconfig- The operator that given the exising value for the aspect, produces a new one- Returns:
- a new
Configurationwith a changedConfigurationAspect
-
getConfigurationAspectsAssociatedWith
-
toBuilder
-
builder
-