Class InterpolatorSpecification
A simple value class defining a ConfigurationInterpolator.
Objects of this class can be used for creating new ConfigurationInterpolator instances; they contain all
required properties. It is either possible to set a fully initialized ConfigurationInterpolator directly
which can be used as is. Alternatively, some or all properties of an instance to be newly created can be set. These
properties include
- a map with
Lookupobjects associated with a specific prefix - a collection with default
Lookupobjects (without a prefix) - a parent
ConfigurationInterpolator - a function used to convert interpolated values into strings
When setting up a configuration it is possible to define the ConfigurationInterpolator in terms of this
class. The configuration will then either use the ConfigurationInterpolator instance explicitly defined in
the InterpolatorSpecification instance or create a new one.
Instances are not created directly, but using the nested Builder class. They are then immutable.
- Since:
- 2.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA builder class for creating instances ofInterpolatorSpecification. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Collection<Lookup> The collection with default lookups.private final ConfigurationInterpolatorTheConfigurationInterpolatorinstance to be used directly.private final ConfigurationInterpolatorThe parentConfigurationInterpolator.The map with prefix lookups.Function used to convert interpolated values to strings. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCreates a new instance ofInterpolatorSpecificationwith the properties defined by the given builder object. -
Method Summary
Modifier and TypeMethodDescriptionGets a collection with the default lookups.Gets theConfigurationInterpolatorinstance to be used directly.Gets the parentConfigurationInterpolatorobject.Gets a map with prefix lookups.Gets the function used to convert interpolated values to strings ornullif the default conversion function is to be used.
-
Field Details
-
interpolator
TheConfigurationInterpolatorinstance to be used directly. -
parentInterpolator
The parentConfigurationInterpolator. -
prefixLookups
The map with prefix lookups. -
defaultLookups
The collection with default lookups. -
stringConverter
Function used to convert interpolated values to strings.
-
-
Constructor Details
-
InterpolatorSpecification
Creates a new instance ofInterpolatorSpecificationwith the properties defined by the given builder object.- Parameters:
builder- the builder
-
-
Method Details
-
getDefaultLookups
Gets a collection with the default lookups.- Returns:
- the default lookups for a new
ConfigurationInterpolatorinstance (never null)
-
getInterpolator
Gets theConfigurationInterpolatorinstance to be used directly.- Returns:
- the
ConfigurationInterpolator(can be null)
-
getParentInterpolator
Gets the parentConfigurationInterpolatorobject.- Returns:
- the parent
ConfigurationInterpolator(can be null)
-
getPrefixLookups
Gets a map with prefix lookups. The keys of the map are the prefix strings, its values are the correspondingLookupobjects.- Returns:
- the prefix lookups for a new
ConfigurationInterpolatorinstance (never null)
-
getStringConverter
Gets the function used to convert interpolated values to strings ornullif the default conversion function is to be used.- Returns:
- function used to convert interpolated values to strings or
nullif the default conversion function is to be used
-