public final class Config extends Object
src/main/resources/oshi.properties for default values.| Modifier and Type | Class and Description |
|---|---|
static class |
Config.PropertyException
Indicates that a configuration value is invalid.
|
| Modifier and Type | Method and Description |
|---|---|
static void |
clear()
Clear the configuration.
|
static boolean |
get(String key,
boolean def)
Get the
boolean property associated with the given key. |
static double |
get(String key,
double def)
Get the
double property associated with the given key. |
static int |
get(String key,
int def)
Get the
int property associated with the given key. |
static String |
get(String key,
String def)
Get the
String property associated with the given key. |
static void |
load(Properties properties)
Load the given
Properties into the global configuration. |
static void |
remove(String key)
Reset the given property to its default value.
|
static void |
set(String key,
Object val)
Set the given property, overwriting any existing value.
|
public static String get(String key, String def)
String property associated with the given key.key - The property keydef - The default valuepublic static int get(String key, int def)
int property associated with the given key.key - The property keydef - The default valuepublic static double get(String key, double def)
double property associated with the given key.key - The property keydef - The default valuepublic static boolean get(String key, boolean def)
boolean property associated with the given key.key - The property keydef - The default valuepublic static void set(String key, Object val)
null, the property is removed.key - The property keyval - The new valuepublic static void remove(String key)
key - The property keypublic static void clear()
public static void load(Properties properties)
Properties into the global configuration.properties - The new propertiesCopyright © 2020. All rights reserved.