Package de.vinado.boot.secrets
Class CompositePropertyIndexSupplier
java.lang.Object
de.vinado.boot.secrets.CompositePropertyIndexSupplier
- All Implemented Interfaces:
PropertyIndexSupplier
,Supplier<Map<String,
String>>
Composite
PropertyIndexSupplier
managing delegates of its own type.- Author:
- Vincent Nadoll
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Convenience component making use of the Builder Pattern to instantiate a newCompositePropertyIndexSupplier
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a newCompositePropertyIndexSupplier.Builder
throwing an exception lazily in caseget()
encounters duplicate keys while merging the underlyingdelegates
.get()
Merges and returns a map of all delegates this component holds.keeping()
Creates a newCompositePropertyIndexSupplier.Builder
keeping existing values of duplicate keys duringmerge
.Creates a newCompositePropertyIndexSupplier.Builder
overriding existing values of duplicate keys duringmerge
.substitute
(PropertyResolver resolver) Substitutes the entry's value.substituteValues
(PropertyResolver resolver) Creates an index supplier which substitutes every value contained by the underlying map.using
(BinaryOperator<String> mergeFunction) Creates a newCompositePropertyIndexSupplier.Builder
using the given merge function to handle duplicate keys duringmerge
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface de.vinado.boot.secrets.PropertyIndexSupplier
substituteValue
-
Constructor Details
-
CompositePropertyIndexSupplier
public CompositePropertyIndexSupplier()
-
-
Method Details
-
get
Merges and returns a map of all delegates this component holds. The merge strategy is implicitly set be the prior used instantiation ofCompositePropertyIndexSupplier.Builder
.- Specified by:
get
in interfaceSupplier<Map<String,
String>> - Returns:
- a merged result map of all delegates
- Throws:
IllegalStateException
- in casebuilder()
where used to instantiate theCompositePropertyIndexSupplier.Builder
and the delegates contain duplicate keys.- See Also:
-
substituteValues
Description copied from interface:PropertyIndexSupplier
Creates an index supplier which substitutes every value contained by the underlying map.- Specified by:
substituteValues
in interfacePropertyIndexSupplier
- Parameters:
resolver
- the component that resolves system property- Returns:
- new instance of a substituting index supplier
-
substitute
Description copied from interface:PropertyIndexSupplier
Substitutes the entry's value.- Specified by:
substitute
in interfacePropertyIndexSupplier
- Parameters:
resolver
- the component that resolves system property- Returns:
- a function which substitutes its argument
-
builder
Creates a newCompositePropertyIndexSupplier.Builder
throwing an exception lazily in caseget()
encounters duplicate keys while merging the underlyingdelegates
.- Returns:
- a new instance of
CompositePropertyIndexSupplier.Builder
- See Also:
-
keeping
Creates a newCompositePropertyIndexSupplier.Builder
keeping existing values of duplicate keys duringmerge
.- Returns:
- a new instance of
CompositePropertyIndexSupplier.Builder
-
overriding
Creates a newCompositePropertyIndexSupplier.Builder
overriding existing values of duplicate keys duringmerge
.- Returns:
- a new instance of
CompositePropertyIndexSupplier.Builder
-
using
Creates a newCompositePropertyIndexSupplier.Builder
using the given merge function to handle duplicate keys duringmerge
.- Returns:
- a new instance of
CompositePropertyIndexSupplier.Builder
-