@Public @ThreadSafe public class Options extends Object implements Serializable
| 构造器和说明 |
|---|
Options()
Creates a new empty configuration.
|
Options(Map<String,String> map)
Creates a new configuration that is initialized with the options of the given map.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addAllToProperties(Properties props)
Adds all entries in these options to the given
Properties. |
boolean |
contains(ConfigOption<?> configOption)
Checks whether there is an entry for the given config option.
|
boolean |
containsKey(String key) |
boolean |
equals(Object o) |
static Options |
fromMap(Map<String,String> map) |
<T> T |
get(ConfigOption<T> option) |
String |
get(String key) |
boolean |
getBoolean(String key,
boolean defaultValue) |
int |
getInteger(String key,
int defaultValue) |
long |
getLong(String key,
long defaultValue) |
<T> Optional<T> |
getOptional(ConfigOption<T> option) |
String |
getString(ConfigOption<String> option) |
String |
getString(String key,
String defaultValue) |
int |
hashCode() |
Set<String> |
keySet() |
void |
remove(String key) |
Options |
removePrefix(String prefix) |
<T> Options |
set(ConfigOption<T> option,
T value) |
void |
set(String key,
String value) |
void |
setInteger(String key,
int value) |
void |
setString(String key,
String value)
Adds the given key/value pair to the configuration object.
|
Map<String,String> |
toMap() |
public void setString(String key, String value)
key - the key of the key/value pair to be addedvalue - the value of the key/value pair to be addedpublic <T> Options set(ConfigOption<T> option, T value)
public <T> T get(ConfigOption<T> option)
public <T> Optional<T> getOptional(ConfigOption<T> option)
public boolean contains(ConfigOption<?> configOption)
configOption - The configuration optionpublic void remove(String key)
public boolean containsKey(String key)
public void addAllToProperties(Properties props)
Properties.public String getString(ConfigOption<String> option)
public boolean getBoolean(String key, boolean defaultValue)
public int getInteger(String key, int defaultValue)
public void setInteger(String key, int value)
public long getLong(String key, long defaultValue)
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.