java.lang.Object
org.meeuw.configuration.Configuration
- All Implemented Interfaces:
Iterable<ConfigurationAspect>
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) iterator()Converts this configuration into a newConfiguration.Builder, so it can be converted to a new configuration set.<E extends ConfigurationAspect>
Configurationwith(Class<E> clazz, UnaryOperator<E> config) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
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 aspectV- the type of the configuration aspect value- 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
Converts this configuration into a newConfiguration.Builder, so it can be converted to a new configuration set. -
builder
- Returns:
- returns a new
Configuration.Builderto assemble a new configuration
-
iterator
- Specified by:
iteratorin interfaceIterable<ConfigurationAspect>
-