T - type of storage configuration to provide.public abstract class StorageConfiguration<T> extends Object implements Serializable
T.| Constructor and Description |
|---|
StorageConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
static <U> U |
castConfiguration(Object conf,
Class<U> clazz) |
boolean |
getBoolean(String key,
boolean defaultValue)
Gets the boolean value of a property key if present, or the default value if not.
|
<T extends Enum<T>> |
getEnum(String key,
T defaultValue)
Gets the Enum value of a property key if present, or the default value if not.
|
abstract StorageConfiguration<T> |
getInline()
Gets an inline version of this storage configuration
|
long |
getLong(String key,
long defaultValue)
Gets the long value of a property key if present, or the default value if not.
|
abstract Option<String> |
getString(String key)
Gets the String value of a property key.
|
String |
getString(String key,
String defaultValue)
Gets the String value of a property key if present, or the default value if not.
|
abstract StorageConfiguration<T> |
newInstance() |
abstract void |
set(String key,
String value)
Sets the configuration key-value pair.
|
void |
setIfUnset(String key,
String value)
Sets a property key with a value in the configuration, if the property key
does not already exist.
|
abstract T |
unwrap() |
<U> U |
unwrapAs(Class<U> clazz) |
abstract T |
unwrapCopy() |
<U> U |
unwrapCopyAs(Class<U> clazz) |
public abstract StorageConfiguration<T> newInstance()
StorageConfiguration instance with a new copy of
the configuration of type T.public abstract T unwrap()
T.public abstract T unwrapCopy()
T.public abstract void set(String key, String value)
key - in String.value - in String.public abstract Option<String> getString(String key)
key - property key in String.Option.empty().public abstract StorageConfiguration<T> getInline()
public final <U> U unwrapAs(Class<U> clazz)
U - type to return.clazz - class of U, which is assignable from T.U.public final <U> U unwrapCopyAs(Class<U> clazz)
U - type to return.clazz - class of U, which is assignable from T.U.public final String getString(String key, String defaultValue)
key - property key in String.defaultValue - default value is the property does not exist.public final boolean getBoolean(String key, boolean defaultValue)
key - property key in String.defaultValue - default value is the property does not exist.public final long getLong(String key, long defaultValue)
key - property key in String.defaultValue - default value is the property does not exist.public <T extends Enum<T>> T getEnum(String key, T defaultValue)
T - Enum.key - property key in String.defaultValue - default value is the property does not exist.public final void setIfUnset(String key, String value)
key - property key.value - property value.Copyright © 2025 The Apache Software Foundation. All rights reserved.