Class PropertiesConfigAdapter<T>
- java.lang.Object
-
- io.micrometer.spring.autoconfigure.export.properties.PropertiesConfigAdapter<T>
-
- Type Parameters:
T- The properties type
- Direct Known Subclasses:
StepRegistryPropertiesConfigAdapter
public class PropertiesConfigAdapter<T> extends java.lang.ObjectBase class for properties to config adapters.
-
-
Constructor Summary
Constructors Constructor Description PropertiesConfigAdapter(T properties)Create a newPropertiesConfigAdapterinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <V> Vget(java.util.function.Function<T,V> getter, java.util.function.Supplier<V> fallback)Get the value from the properties or use a fallback from thedefaults.
-
-
-
Constructor Detail
-
PropertiesConfigAdapter
public PropertiesConfigAdapter(T properties)
Create a newPropertiesConfigAdapterinstance.- Parameters:
properties- the source properties
-
-
Method Detail
-
get
protected final <V> V get(java.util.function.Function<T,V> getter, java.util.function.Supplier<V> fallback)
Get the value from the properties or use a fallback from thedefaults.- Type Parameters:
V- the value type- Parameters:
getter- the getter for the propertiesfallback- the fallback method, usually super interface method reference- Returns:
- the property or fallback value
-
-