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
Nested ClassesModifier and TypeClassDescriptionstatic classConvenience component making use of the Builder Pattern to instantiate a newCompositePropertyIndexSupplier. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a newCompositePropertyIndexSupplier.Builderthrowing 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.Builderkeeping existing values of duplicate keys duringmerge.Creates a newCompositePropertyIndexSupplier.Builderoverriding 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.Builderusing 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, waitMethods 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:
getin interfaceSupplier<Map<String,String>> - Returns:
- a merged result map of all delegates
- Throws:
IllegalStateException- in casebuilder()where used to instantiate theCompositePropertyIndexSupplier.Builderand the delegates contain duplicate keys.- See Also:
-
substituteValues
Description copied from interface:PropertyIndexSupplierCreates an index supplier which substitutes every value contained by the underlying map.- Specified by:
substituteValuesin interfacePropertyIndexSupplier- Parameters:
resolver- the component that resolves system property- Returns:
- new instance of a substituting index supplier
-
substitute
Description copied from interface:PropertyIndexSupplierSubstitutes the entry's value.- Specified by:
substitutein interfacePropertyIndexSupplier- Parameters:
resolver- the component that resolves system property- Returns:
- a function which substitutes its argument
-
builder
Creates a newCompositePropertyIndexSupplier.Builderthrowing 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.Builderkeeping existing values of duplicate keys duringmerge.- Returns:
- a new instance of
CompositePropertyIndexSupplier.Builder
-
overriding
Creates a newCompositePropertyIndexSupplier.Builderoverriding existing values of duplicate keys duringmerge.- Returns:
- a new instance of
CompositePropertyIndexSupplier.Builder
-
using
Creates a newCompositePropertyIndexSupplier.Builderusing the given merge function to handle duplicate keys duringmerge.- Returns:
- a new instance of
CompositePropertyIndexSupplier.Builder
-