Class PropertiesConfigAdapter<T>
java.lang.Object
org.springframework.boot.micrometer.metrics.autoconfigure.export.properties.PropertiesConfigAdapter<T>
- Type Parameters:
T- the properties type
- Direct Known Subclasses:
PushRegistryPropertiesConfigAdapter, SimplePropertiesConfigAdapter, StatsdPropertiesConfigAdapter
Base class for properties to config adapters.
- Since:
- 4.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceGets the fallback value, if any.protected static interfaceGets a value from the given properties.protected static interfaceGets the fallback value. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPropertiesConfigAdapter(T properties) Create a newPropertiesConfigAdapterinstance. -
Method Summary
Modifier and TypeMethodDescriptionprotected final <V> @Nullable Vget(PropertiesConfigAdapter.Getter<T, V> getter, PropertiesConfigAdapter.Fallback<V> fallback) Get the value from the properties or use a fallback from thedefaults.protected final <V> Vobtain(PropertiesConfigAdapter.Getter<T, V> getter, PropertiesConfigAdapter.RequiredFallback<V> fallback) Get the value from the properties or use a fallback from thedefaults.
-
Field Details
-
properties
-
-
Constructor Details
-
PropertiesConfigAdapter
Create a newPropertiesConfigAdapterinstance.- Parameters:
properties- the source properties
-
-
Method Details
-
get
protected final <V> @Nullable V get(PropertiesConfigAdapter.Getter<T, V> getter, PropertiesConfigAdapter.Fallback<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
-
obtain
protected final <V> V obtain(PropertiesConfigAdapter.Getter<T, V> getter, PropertiesConfigAdapter.RequiredFallback<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
-