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 Classes -
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, Supplier<@Nullable V> fallback) Get the value from the properties or use a fallback from thedefaults.protected final <V> VgetRequired(PropertiesConfigAdapter.Getter<T, V> getter, Supplier<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, Supplier<@Nullable 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
-
getRequired
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
-