Class ConfigurationParameters
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.security.ConfigurationParameters
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConfigurationParameters.MillisecondsHelper class for configuration parameters that denote a "duration", such as a timeout or expiration time.
-
Field Summary
Fields Modifier and Type Field Description static ConfigurationParametersEMPTYAn empty configuration parameters
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontains(@NotNull String key)Returnstrueif this instance contains a configuration entry with the specified key irrespective of the defined value;falseotherwise.booleancontainsKey(Object key)booleancontainsValue(Object value)@NotNull Set<Map.Entry<String,Object>>entrySet()Objectget(Object key)<T> TgetConfigValue(@NotNull String key, T defaultValue)Returns the value of the configuration entry with the givenkeyapplying the following rules: If this instance doesn't contain a configuration entry with that key, or if the entry isnull, the specifieddefaultValuewill be returned. If the configured value is notnullan attempt is made to convert the configured value to match the type of the default value.<T> TgetConfigValue(@NotNull String key, T defaultValue, @Nullable Class<T> targetClass)Returns the value of the configuration entry with the givenkeyapplying the following rules: If this instance doesn't contain a configuration entry with that key the specifieddefaultValuewill be returned. IfdefaultValueisnullthe original value will be returned. If the configured value isnullthis method will always returnnull. If neitherdefaultValuenor the configured value isnullan attempt is made to convert the configured value to match the type of the default value.<T> TgetConfigValueOrDefault(@NotNull String key, T defaultValue)Returns the value of the configuration entry with the givenkeyapplying the following rules: If this instance doesn't contain a configuration entry with that key, or if the entry isnull, the specifieddefaultValuewill be returned. If the configured value is notnullan attempt is made to convert the configured value to match the type of the default value. If the configured value can not be converted to the default value type the default value is returned.booleanisEmpty()@NotNull Set<String>keySet()static @NotNull ConfigurationParametersof(@NotNull String key, @NotNull Object value)Creates new a single valued configuration parameters instance from the given key and value.static @NotNull ConfigurationParametersof(@NotNull String key1, @NotNull Object value1, @NotNull String key2, @NotNull Object value2)Creates new a configuration parameters instance from the given key and value pairs.static @NotNull ConfigurationParametersof(@NotNull Dictionary<String,Object> properties)Creates new a configuration parameters instance by copying the given properties.static @NotNull ConfigurationParametersof(@NotNull Map<?,?> map)Creates new a configuration parameters instance by copying the given map.static @NotNull ConfigurationParametersof(@NotNull Properties properties)Creates new a configuration parameters instance by copying the given properties.static @NotNull ConfigurationParametersof(@NotNull ConfigurationParameters... params)Creates a new configuration parameters instance by merging allparamssequentially.Objectput(String key, Object value)voidputAll(@NotNull Map<? extends String,?> m)Objectremove(Object key)intsize()@NotNull Collection<Object>values()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Field Detail
-
EMPTY
public static final ConfigurationParameters EMPTY
An empty configuration parameters
-
-
Method Detail
-
of
@NotNull public static @NotNull ConfigurationParameters of(@NotNull @NotNull ConfigurationParameters... params)
Creates a new configuration parameters instance by merging allparamssequentially. I.e. property define in subsequent arguments overwrite the ones before.- Parameters:
params- source parameters to merge- Returns:
- merged configuration parameters or
EMPTYif all source params were empty.
-
of
@NotNull public static @NotNull ConfigurationParameters of(@NotNull @NotNull Properties properties)
Creates new a configuration parameters instance by copying the given properties.- Parameters:
properties- source properties- Returns:
- configuration parameters or
EMPTYif the source properties were empty.
-
of
@NotNull public static @NotNull ConfigurationParameters of(@NotNull @NotNull Dictionary<String,Object> properties)
Creates new a configuration parameters instance by copying the given properties.- Parameters:
properties- source properties- Returns:
- configuration parameters or
EMPTYif the source properties were empty.
-
of
@NotNull public static @NotNull ConfigurationParameters of(@NotNull @NotNull Map<?,?> map)
Creates new a configuration parameters instance by copying the given map.- Parameters:
map- source map- Returns:
- configuration parameters or
EMPTYif the source map was empty.
-
of
@NotNull public static @NotNull ConfigurationParameters of(@NotNull @NotNull String key, @NotNull @NotNull Object value)
Creates new a single valued configuration parameters instance from the given key and value.- Parameters:
key- The keyvalue- The value- Returns:
- a new instance of configuration parameters.
-
of
@NotNull public static @NotNull ConfigurationParameters of(@NotNull @NotNull String key1, @NotNull @NotNull Object value1, @NotNull @NotNull String key2, @NotNull @NotNull Object value2)
Creates new a configuration parameters instance from the given key and value pairs.- Parameters:
key1- The key of the first pair.value1- The value of the first pairkey2- The key of the second pair.value2- The value of the second pair.- Returns:
- a new instance of configuration parameters.
-
contains
public boolean contains(@NotNull @NotNull String key)Returnstrueif this instance contains a configuration entry with the specified key irrespective of the defined value;falseotherwise.- Parameters:
key- The key to be tested.- Returns:
trueif this instance contains a configuration entry with the specified key irrespective of the defined value;falseotherwise.
-
getConfigValue
@Nullable public <T> T getConfigValue(@NotNull @NotNull String key, @Nullable T defaultValue, @Nullable @Nullable Class<T> targetClass)Returns the value of the configuration entry with the givenkeyapplying the following rules:- If this instance doesn't contain a configuration entry with that
key the specified
defaultValuewill be returned. - If
defaultValueisnullthe original value will be returned. - If the configured value is
nullthis method will always returnnull. - If neither
defaultValuenor the configured value isnullan attempt is made to convert the configured value to match the type of the default value.
- Parameters:
key- The name of the configuration option.defaultValue- The default value to return if no such entry exists or to use for conversion.targetClass- The target class- Returns:
- The original or converted configuration value or
null.
- If this instance doesn't contain a configuration entry with that
key the specified
-
getConfigValue
@NotNull public <T> T getConfigValue(@NotNull @NotNull String key, @NotNull T defaultValue)Returns the value of the configuration entry with the givenkeyapplying the following rules:- If this instance doesn't contain a configuration entry with that
key, or if the entry is
null, the specifieddefaultValuewill be returned. - If the configured value is not
nullan attempt is made to convert the configured value to match the type of the default value.
- Parameters:
key- The name of the configuration option.defaultValue- The default value to return if no such entry exists or to use for conversion.- Returns:
- The original or converted configuration value or
defaultValueif no entry for the given key exists.
- If this instance doesn't contain a configuration entry with that
key, or if the entry is
-
getConfigValueOrDefault
@NotNull public <T> T getConfigValueOrDefault(@NotNull @NotNull String key, @NotNull T defaultValue)Returns the value of the configuration entry with the givenkeyapplying the following rules:- If this instance doesn't contain a configuration entry with that
key, or if the entry is
null, the specifieddefaultValuewill be returned. - If the configured value is not
nullan attempt is made to convert the configured value to match the type of the default value. - If the configured value can not be converted to the default value type the default value is returned.
- Parameters:
key- The name of the configuration option.defaultValue- The default value to return if no such entry exists or to use for conversion.- Returns:
- The original or converted configuration value or
defaultValueif no entry for the given key exists or if a conversion error occurred.
- If this instance doesn't contain a configuration entry with that
key, or if the entry is
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKeyin interfaceMap<String,Object>
-
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValuein interfaceMap<String,Object>
-
values
@NotNull public @NotNull Collection<Object> values()
-
-