Class ConfigurationUtils
- Opensearch.api:
-
Method Summary
Modifier and TypeMethodDescriptionstatic OpenSearchExceptionnewConfigurationException(String propertyName, String reason) static booleanreadBooleanProperty(Map<String, Object> configuration, String propertyName, boolean defaultValue) static DoublereadDoubleProperty(Map<String, Object> configuration, String propertyName) Returns the specified property from the specified configuration map.static IntegerReturns the specified property from the specified configuration map.static StringreadOptionalStringOrIntProperty(Map<String, Object> configuration, String propertyName) Returns the specified property from the specified configuration map.static StringreadOptionalStringProperty(Map<String, Object> configuration, String propertyName) Returns and removes the specified optional property from the specified configuration map.static StringReturns the specified property from the specified configuration map.static StringreadStringProperty(Map<String, Object> configuration, String propertyName) Returns and removes the specified property from the specified configuration map.static StringReturns the specified property from the specified configuration map.
-
Method Details
-
readOptionalStringProperty
-
readStringProperty
Returns and removes the specified property from the specified configuration map.If the property value isn't of type string an
OpenSearchParseExceptionis thrown. If the property is missing anOpenSearchParseExceptionis thrown -
readStringProperty
public static String readStringProperty(Map<String, Object> configuration, String propertyName, String defaultValue) Returns the specified property from the specified configuration map.If the property value isn't of type string a
OpenSearchParseExceptionis thrown. If the property is missing and no default value has been specified aOpenSearchParseExceptionis thrown -
newConfigurationException
-
readStringOrIntProperty
public static String readStringOrIntProperty(Map<String, Object> configuration, String propertyName, String defaultValue) Returns the specified property from the specified configuration map.If the property value isn't of type string or int a
OpenSearchParseExceptionis thrown. If the property is missing and no default value has been specified aOpenSearchParseExceptionis thrown -
readOptionalStringOrIntProperty
-
readBooleanProperty
-
readIntProperty
public static Integer readIntProperty(Map<String, Object> configuration, String propertyName, Integer defaultValue) Returns the specified property from the specified configuration map.If the property value isn't of type int a
OpenSearchParseExceptionis thrown. If the property is missing anOpenSearchParseExceptionis thrown -
readDoubleProperty
Returns the specified property from the specified configuration map.If the property value isn't of type int a
OpenSearchParseExceptionis thrown. If the property is missing anOpenSearchParseExceptionis thrown
-