public class GeneralSettings extends Object
Settings introduced by BoostedYAML follow builder design pattern, e.g. you may build your own settings using
GeneralSettings.builder() //configure// .build()
| Modifier and Type | Class and Description |
|---|---|
static class |
GeneralSettings.Builder
Builder for general settings.
|
static class |
GeneralSettings.KeyFormat
Key format for sections to use; specifies how the loaded/supplied keys should be formatted.
|
| Modifier and Type | Field and Description |
|---|---|
static GeneralSettings |
DEFAULT
Default general settings.
|
static Boolean |
DEFAULT_BOOLEAN
Default boolean.
|
static String |
DEFAULT_ESCAPED_SEPARATOR
Escaped version of the default separator.
|
static Character |
DEFAULT_CHAR
Default char.
|
static GeneralSettings.KeyFormat |
DEFAULT_KEY_FORMATTING
Default key format.
|
static ListSupplier |
DEFAULT_LIST
Default list supplier.
|
static MapSupplier |
DEFAULT_MAP
Default map supplier.
|
static Number |
DEFAULT_NUMBER
Default number.
|
static Object |
DEFAULT_OBJECT
Default object.
|
static char |
DEFAULT_ROUTE_SEPARATOR
The default string route separator.
|
static YamlSerializer |
DEFAULT_SERIALIZER
Default serializer.
|
static SetSupplier |
DEFAULT_SET
Default set supplier.
|
static String |
DEFAULT_STRING
Default string.
|
static boolean |
DEFAULT_USE_DEFAULTS
If to use defaults by default.
|
| Modifier and Type | Method and Description |
|---|---|
static GeneralSettings.Builder |
builder()
Returns a new builder.
|
static GeneralSettings.Builder |
builder(GeneralSettings settings)
Returns a new builder with the same configuration as the given settings.
|
Boolean |
getDefaultBoolean()
Returns default boolean to use by
Section getters if the return type is boolean. |
Character |
getDefaultChar()
Returns default char to use by
Section getters if the return type is char. |
<T> List<T> |
getDefaultList()
Returns an empty default list.
|
<T> List<T> |
getDefaultList(int size)
Returns default list of the given size.
|
<K,V> Map<K,V> |
getDefaultMap()
Returns an empty default map.
|
<K,V> Map<K,V> |
getDefaultMap(int size)
Returns default map of the given size.
|
MapSupplier |
getDefaultMapSupplier()
Returns default map supplier to use to supply map instances during loading/creating new sections/when needed.
|
Number |
getDefaultNumber()
Returns default number to use by
Section getters if the return type is a number - integer, float, byte,
biginteger... |
Object |
getDefaultObject()
Returns default object to use by
Section getters if the return type is object. |
<T> Set<T> |
getDefaultSet()
Returns an empty default set.
|
<T> Set<T> |
getDefaultSet(int size)
Returns default set of the given size.
|
String |
getDefaultString()
Returns default string to use by
Section getters if the return type is string. |
String |
getEscapedSeparator()
Returns the escaped route separator.
|
GeneralSettings.KeyFormat |
getKeyFormat()
Returns the key format to use.
|
char |
getRouteSeparator()
Sets route separator used to separate individual keys inside a string route and vice-versa.
|
YamlSerializer |
getSerializer()
Returns serializer to use for custom object serialization/deserialization.
|
boolean |
isUseDefaults()
Returns if to enable use of the defaults by
Section methods (if any are present). |
public static final char DEFAULT_ROUTE_SEPARATOR
public static final String DEFAULT_ESCAPED_SEPARATOR
public static final GeneralSettings.KeyFormat DEFAULT_KEY_FORMATTING
public static final YamlSerializer DEFAULT_SERIALIZER
public static final boolean DEFAULT_USE_DEFAULTS
public static final Object DEFAULT_OBJECT
public static final Number DEFAULT_NUMBER
public static final String DEFAULT_STRING
public static final Character DEFAULT_CHAR
public static final Boolean DEFAULT_BOOLEAN
public static final ListSupplier DEFAULT_LIST
public static final SetSupplier DEFAULT_SET
public static final MapSupplier DEFAULT_MAP
public static final GeneralSettings DEFAULT
public GeneralSettings.KeyFormat getKeyFormat()
Builder#setKeyFormat(KeyFormat)public char getRouteSeparator()
public String getEscapedSeparator()
getRouteSeparator()public YamlSerializer getSerializer()
public boolean isUseDefaults()
Section methods (if any are present).public Object getDefaultObject()
Section getters if the return type is object.public String getDefaultString()
Section getters if the return type is string.public Character getDefaultChar()
Section getters if the return type is char.public Number getDefaultNumber()
Section getters if the return type is a number - integer, float, byte,
biginteger... (per the getter documentation).public Boolean getDefaultBoolean()
Section getters if the return type is boolean.public <T> List<T> getDefaultList(int size)
T - content typesize - initial size (if supported)public <T> List<T> getDefaultList()
T - content typepublic <T> Set<T> getDefaultSet(int size)
T - content typesize - initial size (if supported)public <T> Set<T> getDefaultSet()
T - content typepublic <K,V> Map<K,V> getDefaultMap(int size)
K - key typeV - value typesize - initial size (if supported)public <K,V> Map<K,V> getDefaultMap()
K - key typeV - value typepublic MapSupplier getDefaultMapSupplier()
public static GeneralSettings.Builder builder()
public static GeneralSettings.Builder builder(GeneralSettings settings)
settings - preset settingsCopyright © 2022. All rights reserved.