Class PropertyValidator
java.lang.Object
io.micrometer.core.instrument.config.validate.PropertyValidator
Validator for properties.
- Since:
- 1.5.0
-
Method Summary
Modifier and TypeMethodDescriptiongetBoolean(MeterRegistryConfig config, String property) getDuration(MeterRegistryConfig config, String property) getEnum(MeterRegistryConfig config, Class<E> enumClass, String property) getInteger(MeterRegistryConfig config, String property) getSecret(MeterRegistryConfig config, String property) getString(MeterRegistryConfig config, String property) getStringMap(MeterRegistryConfig config, String property, Function<String, ? extends V> valueMapper) Populate a Map from the given property value in the format of key1=value1,key2=value2.getTimeUnit(MeterRegistryConfig config, String property) getUriString(MeterRegistryConfig config, String property) Get a validated URI string.getUrlString(MeterRegistryConfig config, String property)
-
Method Details
-
getDuration
-
getTimeUnit
-
getInteger
-
getEnum
public static <E extends Enum<E>> Validated<E> getEnum(MeterRegistryConfig config, Class<E> enumClass, String property) -
getBoolean
-
getSecret
-
getString
-
getUrlString
-
getUriString
Get a validated URI string.- Parameters:
config- configproperty- property- Returns:
- a validated URI string
- Since:
- 1.9.14
- See Also:
-
getStringMap
public static <V> Validated<Map<String,V>> getStringMap(MeterRegistryConfig config, String property, Function<String, ? extends V> valueMapper) Populate a Map from the given property value in the format of key1=value1,key2=value2.- Type Parameters:
V- type of the Map values- Parameters:
config- configproperty- name of the propertyvalueMapper- function mapping the value of the key-value pairs contained in the property value to the value stored in the Map- Returns:
- Map with key-values from the given property
- Since:
- 1.15.0
-