Interface UnmodifiableConfig
-
- All Known Subinterfaces:
CommentedConfig,CommentedFileConfig,Config,FileConfig,UnmodifiableCommentedConfig
- All Known Implementing Classes:
AbstractCommentedConfig,AbstractConfig,CommentedConfigWrapper,ConfigWrapper,ConvertedCommentedConfig,ConvertedCommentedFileConfig,ConvertedConfig,ConvertedFileConfig,FakeCommentedConfig,FakeUnmodifiableCommentedConfig,UnmodifiableConfigWrapper
public interface UnmodifiableConfigAn unmodifiable (read-only) configuration that contains key/value mappings.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceUnmodifiableConfig.EntryAn unmodifiable config entry.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> Tapply(java.lang.String path)For scala: gets a config value.default <T> Tapply(java.util.List<java.lang.String> path)For scala: gets a config value.ConfigFormat<?>configFormat()Returns the config's format.default booleancontains(java.lang.String path)Checks if the config contains a value at some path.booleancontains(java.util.List<java.lang.String> path)Checks if the config contains a value at some path.java.util.Set<? extends UnmodifiableConfig.Entry>entrySet()Returns a Set view of the config's entries.default <T> Tget(java.lang.String path)Gets a value from the config.default <T> Tget(java.util.List<java.lang.String> path)Gets a value from the config.default bytegetByte(java.lang.String path)default bytegetByte(java.util.List<java.lang.String> path)default bytegetByteOrElse(java.lang.String path, byte defaultValue)default bytegetByteOrElse(java.util.List<java.lang.String> path, byte defaultValue)default chargetChar(java.lang.String path)Returns a char value from the configuration.default chargetChar(java.util.List<java.lang.String> path)Returns a char value from the configuration.default chargetCharOrElse(java.lang.String path, char defaultValue)Returns a char value from the configuration.default chargetCharOrElse(java.util.List<java.lang.String> path, char defaultValue)Returns a char value from the configuration.default <T extends java.lang.Enum<T>>
TgetEnum(java.lang.String path, java.lang.Class<T> enumType)CallsgetEnum(String, Class, EnumGetMethod)with methodEnumGetMethod.NAME_IGNORECASE.default <T extends java.lang.Enum<T>>
TgetEnum(java.lang.String path, java.lang.Class<T> enumType, EnumGetMethod method)Gets an Enum value from the config.default <T extends java.lang.Enum<T>>
TgetEnum(java.util.List<java.lang.String> path, java.lang.Class<T> enumType)CallsgetEnum(List, Class, EnumGetMethod)with methodEnumGetMethod.NAME_IGNORECASE.default <T extends java.lang.Enum<T>>
TgetEnum(java.util.List<java.lang.String> path, java.lang.Class<T> enumType, EnumGetMethod method)Gets an Enum value from the config.default <T extends java.lang.Enum<T>>
TgetEnumOrElse(java.lang.String path, java.lang.Class<T> enumType, EnumGetMethod method, java.util.function.Supplier<T> defaultValueSupplier)Gets an Enum value from the config.default <T extends java.lang.Enum<T>>
TgetEnumOrElse(java.lang.String path, java.lang.Class<T> enumType, java.util.function.Supplier<T> defaultValueSupplier)default <T extends java.lang.Enum<T>>
TgetEnumOrElse(java.lang.String path, T defaultValue)CallsgetEnumOrElse(String, Enum, EnumGetMethod)with methodEnumGetMethod.NAME_IGNORECASE.default <T extends java.lang.Enum<T>>
TgetEnumOrElse(java.lang.String path, T defaultValue, EnumGetMethod method)Gets an Enum value from the config.default <T extends java.lang.Enum<T>>
TgetEnumOrElse(java.util.List<java.lang.String> path, java.lang.Class<T> enumType, EnumGetMethod method, java.util.function.Supplier<T> defaultValueSupplier)Gets an Enum value from the config.default <T extends java.lang.Enum<T>>
TgetEnumOrElse(java.util.List<java.lang.String> path, java.lang.Class<T> enumType, java.util.function.Supplier<T> defaultValueSupplier)CallsgetEnumOrElse(List, Class, EnumGetMethod, Supplier)with methodEnumGetMethod.NAME_IGNORECASE.default <T extends java.lang.Enum<T>>
TgetEnumOrElse(java.util.List<java.lang.String> path, T defaultValue)CallsgetEnumOrElse(List, Enum, EnumGetMethod)with methodEnumGetMethod.NAME_IGNORECASE.default <T extends java.lang.Enum<T>>
TgetEnumOrElse(java.util.List<java.lang.String> path, T defaultValue, EnumGetMethod method)Gets an Enum value from the config.default intgetInt(java.lang.String path)Likeget(String)but returns a primitive int.default intgetInt(java.util.List<java.lang.String> path)Likeget(List)but returns a primitive int.default intgetIntOrElse(java.lang.String path, int defaultValue)LikegetOrElse(String, Object)but returns a primitive int.default intgetIntOrElse(java.lang.String path, java.util.function.IntSupplier defaultValueSupplier)LikegetOrElse(String, Supplier)but returns a primitive int.default intgetIntOrElse(java.util.List<java.lang.String> path, int defaultValue)LikegetOrElse(List, Object)but returns a primitive int.default intgetIntOrElse(java.util.List<java.lang.String> path, java.util.function.IntSupplier defaultValueSupplier)LikegetOrElse(List, Supplier)but returns a primitive int.default longgetLong(java.lang.String path)Likeget(String)but returns a primitive long.default longgetLong(java.util.List<java.lang.String> path)Likeget(List)but returns a primitive long.default longgetLongOrElse(java.lang.String path, long defaultValue)LikegetOrElse(String, Object)but returns a primitive long.default longgetLongOrElse(java.lang.String path, java.util.function.LongSupplier defaultValueSupplier)LikegetOrElse(String, Supplier)but returns a primitive long.default longgetLongOrElse(java.util.List<java.lang.String> path, long defaultValue)LikegetOrElse(List, Object)but returns a primitive long.default longgetLongOrElse(java.util.List<java.lang.String> path, java.util.function.LongSupplier defaultValueSupplier)LikegetOrElse(List, Supplier)but returns a primitive long.default <T> java.util.Optional<T>getOptional(java.lang.String path)Gets an optional value from the config.default <T> java.util.Optional<T>getOptional(java.util.List<java.lang.String> path)Gets an optional value from the config.default <T extends java.lang.Enum<T>>
java.util.Optional<T>getOptionalEnum(java.lang.String path, java.lang.Class<T> enumType)CallsgetOptionalEnum(String, Class, EnumGetMethod)with methodEnumGetMethod.NAME_IGNORECASE.default <T extends java.lang.Enum<T>>
java.util.Optional<T>getOptionalEnum(java.lang.String path, java.lang.Class<T> enumType, EnumGetMethod method)Gets an optional Enum value from the config.default <T extends java.lang.Enum<T>>
java.util.Optional<T>getOptionalEnum(java.util.List<java.lang.String> path, java.lang.Class<T> enumType)CallsgetOptionalEnum(List, Class, EnumGetMethod)with methodEnumGetMethod.NAME_IGNORECASE.default <T extends java.lang.Enum<T>>
java.util.Optional<T>getOptionalEnum(java.util.List<java.lang.String> path, java.lang.Class<T> enumType, EnumGetMethod method)Gets an optional Enum value from the config.default java.util.OptionalIntgetOptionalInt(java.lang.String path)LikegetOptional(String)but returns a primitive int.default java.util.OptionalIntgetOptionalInt(java.util.List<java.lang.String> path)LikegetOptional(List)but returns a primitive int.default java.util.OptionalLonggetOptionalLong(java.lang.String path)LikegetOptional(String)but returns a primitive long.default java.util.OptionalLonggetOptionalLong(java.util.List<java.lang.String> path)LikegetOptional(List)but returns a primitive long.default <T> TgetOrElse(java.lang.String path, java.util.function.Supplier<T> defaultValueSupplier)Gets a value from the config.default <T> TgetOrElse(java.lang.String path, T defaultValue)Gets a value from the config.default <T> TgetOrElse(java.util.List<java.lang.String> path, java.util.function.Supplier<T> defaultValueSupplier)Gets a value from the config.default <T> TgetOrElse(java.util.List<java.lang.String> path, T defaultValue)Gets a value from the config.default <T> TgetRaw(java.lang.String path)Gets a value from the config.<T> TgetRaw(java.util.List<java.lang.String> path)Gets a value from the config.default shortgetShort(java.lang.String path)default shortgetShort(java.util.List<java.lang.String> path)default shortgetShortOrElse(java.lang.String path, short defaultValue)default shortgetShortOrElse(java.util.List<java.lang.String> path, short defaultValue)default booleanisEmpty()Checks if the config is empty.default booleanisNull(java.lang.String path)Checks if the config contains a null value at some path.default booleanisNull(java.util.List<java.lang.String> path)Checks if the config contains a null value at some path.intsize()Gets the size of the config.java.util.Map<java.lang.String,java.lang.Object>valueMap()Returns a Map view of the config's values.
-
-
-
Method Detail
-
get
default <T> T get(java.lang.String path)
Gets a value from the config.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each part separated by a dot. Example "a.b.c"- Returns:
- the value at the given path, or
nullif there is no such value.
-
get
default <T> T get(java.util.List<java.lang.String> path)
Gets a value from the config.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each element of the list is a different part of the path.- Returns:
- the value at the given path, or
nullif there is no such value.
-
getRaw
default <T> T getRaw(java.lang.String path)
Gets a value from the config. Doesn't convertNullObject.NULL_OBJECTtonull.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each part separated by a dot. Example "a.b.c"- Returns:
- the value at the given path, or
nullif there is no such value.
-
getRaw
<T> T getRaw(java.util.List<java.lang.String> path)
Gets a value from the config. Doesn't convertNullObject.NULL_OBJECTtonull.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each element of the list is a different part of the path.- Returns:
- the value at the given path, or
nullif there is no such value.
-
getOptional
default <T> java.util.Optional<T> getOptional(java.lang.String path)
Gets an optional value from the config.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each part separated by a dot. Example "a.b.c"- Returns:
- an Optional containing the value at the given path, or
Optional.empty()if there is no such value.
-
getOptional
default <T> java.util.Optional<T> getOptional(java.util.List<java.lang.String> path)
Gets an optional value from the config.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each element of the list is a different part of the path.- Returns:
- an Optional containing the value at the given path, or
Optional.empty()if there is no such value.
-
getOrElse
default <T> T getOrElse(java.lang.String path, T defaultValue)Gets a value from the config. If the value doesn't exist, returns the default value.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each part separated by a dot. Example "a.b.c"defaultValue- the default value to return if not found- Returns:
- the value at the given path, or the default value if not found.
-
getOrElse
default <T> T getOrElse(java.util.List<java.lang.String> path, T defaultValue)Gets a value from the config. If the value doesn't exist, returns the default value.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each element of the list is a different part of the path.defaultValue- the default value to return if not found- Returns:
- the value at the given path, or the default value if not found.
-
getOrElse
default <T> T getOrElse(java.util.List<java.lang.String> path, java.util.function.Supplier<T> defaultValueSupplier)Gets a value from the config. If the value doesn't exist, returns the default value.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each element of the list is a different part of the path.defaultValueSupplier- the Supplier of the default value- Returns:
- the value at the given path, or the default value if not found.
-
getOrElse
default <T> T getOrElse(java.lang.String path, java.util.function.Supplier<T> defaultValueSupplier)Gets a value from the config. If the value doesn't exist, returns the default value.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each part separated by a dot. Example "a.b.c"defaultValueSupplier- the Supplier of the default value- Returns:
- the value at the given path, or the default value if not found.
-
getEnum
default <T extends java.lang.Enum<T>> T getEnum(java.lang.String path, java.lang.Class<T> enumType, EnumGetMethod method)Gets an Enum value from the config. If the value doesn't exist, returns null.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each part separated by a dot. Example "a.b.c"enumType- the class of the Enummethod- the method to use when converting a non-enum value like a String or an int- Returns:
- the value at the given path as an enum, or null value if not found.
- Throws:
java.lang.IllegalArgumentException- if the config contains a String that doesn't match any of the enum constants, with regards to the given methodjava.lang.ClassCastException- if the config contains a value that cannot be converted to an enum constant, like a List
-
getEnum
default <T extends java.lang.Enum<T>> T getEnum(java.lang.String path, java.lang.Class<T> enumType)CallsgetEnum(String, Class, EnumGetMethod)with methodEnumGetMethod.NAME_IGNORECASE.
-
getEnum
default <T extends java.lang.Enum<T>> T getEnum(java.util.List<java.lang.String> path, java.lang.Class<T> enumType, EnumGetMethod method)Gets an Enum value from the config. If the value doesn't exist, returns null.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each element of the list is a different part of the path.enumType- the class of the Enummethod- the method to use when converting a non-enum value like a String or an int- Returns:
- the value at the given path as an enum, or null value if not found.
- Throws:
java.lang.IllegalArgumentException- if the config contains a String that doesn't match any of the enum constants, with regards to the given methodjava.lang.ClassCastException- if the config contains a value that cannot be converted to an enum constant, like a List
-
getEnum
default <T extends java.lang.Enum<T>> T getEnum(java.util.List<java.lang.String> path, java.lang.Class<T> enumType)CallsgetEnum(List, Class, EnumGetMethod)with methodEnumGetMethod.NAME_IGNORECASE.
-
getOptionalEnum
default <T extends java.lang.Enum<T>> java.util.Optional<T> getOptionalEnum(java.lang.String path, java.lang.Class<T> enumType, EnumGetMethod method)Gets an optional Enum value from the config.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each part separated by a dot. Example "a.b.c"enumType- the class of the Enummethod- the method to use when converting a non-enum value like a String or an int- Returns:
- the value at the given path as an enum, or null value if not found.
- Throws:
java.lang.IllegalArgumentException- if the config contains a String that doesn't match any of the enum constants, with regards to the given methodjava.lang.ClassCastException- if the config contains a value that cannot be converted to an enum constant, like a List
-
getOptionalEnum
default <T extends java.lang.Enum<T>> java.util.Optional<T> getOptionalEnum(java.lang.String path, java.lang.Class<T> enumType)CallsgetOptionalEnum(String, Class, EnumGetMethod)with methodEnumGetMethod.NAME_IGNORECASE.
-
getOptionalEnum
default <T extends java.lang.Enum<T>> java.util.Optional<T> getOptionalEnum(java.util.List<java.lang.String> path, java.lang.Class<T> enumType, EnumGetMethod method)Gets an optional Enum value from the config.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each element of the list is a different part of the path.enumType- the class of the Enummethod- the method to use when converting a non-enum value like a String or an int- Returns:
- the value at the given path as an enum, or null value if not found.
- Throws:
java.lang.IllegalArgumentException- if the config contains a String that doesn't match any of the enum constants, with regards to the given methodjava.lang.ClassCastException- if the config contains a value that cannot be converted to an enum constant, like a List
-
getOptionalEnum
default <T extends java.lang.Enum<T>> java.util.Optional<T> getOptionalEnum(java.util.List<java.lang.String> path, java.lang.Class<T> enumType)CallsgetOptionalEnum(List, Class, EnumGetMethod)with methodEnumGetMethod.NAME_IGNORECASE.
-
getEnumOrElse
default <T extends java.lang.Enum<T>> T getEnumOrElse(java.lang.String path, T defaultValue, EnumGetMethod method)Gets an Enum value from the config. If the value doesn't exist, returns the default value.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each part separated by a dot. Example "a.b.c"defaultValue- the default valuemethod- the method to use when converting a non-enum value like a String or an int- Returns:
- the value at the given path as an enum, or null value if not found.
- Throws:
java.lang.IllegalArgumentException- if the config contains a String that doesn't match any of the enum constants, with regards to the given methodjava.lang.ClassCastException- if the config contains a value that cannot be converted to an enum constant, like a List
-
getEnumOrElse
default <T extends java.lang.Enum<T>> T getEnumOrElse(java.lang.String path, T defaultValue)CallsgetEnumOrElse(String, Enum, EnumGetMethod)with methodEnumGetMethod.NAME_IGNORECASE.
-
getEnumOrElse
default <T extends java.lang.Enum<T>> T getEnumOrElse(java.util.List<java.lang.String> path, T defaultValue, EnumGetMethod method)Gets an Enum value from the config. If the value doesn't exist, returns the default value.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each element of the list is a different part of the path.defaultValue- the default valuemethod- the method to use when converting a non-enum value like a String or an int- Returns:
- the value at the given path as an enum, or null value if not found.
- Throws:
java.lang.IllegalArgumentException- if the config contains a String that doesn't match any of the enum constants, with regards to the given methodjava.lang.ClassCastException- if the config contains a value that cannot be converted to an enum constant, like a List
-
getEnumOrElse
default <T extends java.lang.Enum<T>> T getEnumOrElse(java.util.List<java.lang.String> path, T defaultValue)CallsgetEnumOrElse(List, Enum, EnumGetMethod)with methodEnumGetMethod.NAME_IGNORECASE.
-
getEnumOrElse
default <T extends java.lang.Enum<T>> T getEnumOrElse(java.lang.String path, java.lang.Class<T> enumType, EnumGetMethod method, java.util.function.Supplier<T> defaultValueSupplier)Gets an Enum value from the config. If the value doesn't exist, returns the default value.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each element of the list is a different part of the path.defaultValueSupplier- Supplier of the default value, only used if neededmethod- the method to use when converting a non-enum value like a String or an int- Returns:
- the value at the given path as an enum, or null value if not found.
- Throws:
java.lang.IllegalArgumentException- if the config contains a String that doesn't match any of the enum constants, with regards to the given methodjava.lang.ClassCastException- if the config contains a value that cannot be converted to an enum constant, like a List
-
getEnumOrElse
default <T extends java.lang.Enum<T>> T getEnumOrElse(java.lang.String path, java.lang.Class<T> enumType, java.util.function.Supplier<T> defaultValueSupplier)
-
getEnumOrElse
default <T extends java.lang.Enum<T>> T getEnumOrElse(java.util.List<java.lang.String> path, java.lang.Class<T> enumType, EnumGetMethod method, java.util.function.Supplier<T> defaultValueSupplier)Gets an Enum value from the config. If the value doesn't exist, returns the default value.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each element of the list is a different part of the path.defaultValueSupplier- Supplier of the default value, only used if neededmethod- the method to use when converting a non-enum value like a String or an int- Returns:
- the value at the given path as an enum, or null value if not found.
- Throws:
java.lang.IllegalArgumentException- if the config contains a String that doesn't match any of the enum constants, with regards to the given methodjava.lang.ClassCastException- if the config contains a value that cannot be converted to an enum constant, like a List
-
getEnumOrElse
default <T extends java.lang.Enum<T>> T getEnumOrElse(java.util.List<java.lang.String> path, java.lang.Class<T> enumType, java.util.function.Supplier<T> defaultValueSupplier)CallsgetEnumOrElse(List, Class, EnumGetMethod, Supplier)with methodEnumGetMethod.NAME_IGNORECASE.
-
getInt
default int getInt(java.lang.String path)
Likeget(String)but returns a primitive int. The config's value must be aNumber.
-
getInt
default int getInt(java.util.List<java.lang.String> path)
Likeget(List)but returns a primitive int. The config's value must be aNumber.
-
getOptionalInt
default java.util.OptionalInt getOptionalInt(java.lang.String path)
LikegetOptional(String)but returns a primitive int. The config's value must be aNumberor null or nonexistant.
-
getOptionalInt
default java.util.OptionalInt getOptionalInt(java.util.List<java.lang.String> path)
LikegetOptional(List)but returns a primitive int. The config's value must be aNumberor null or nonexistant.
-
getIntOrElse
default int getIntOrElse(java.lang.String path, int defaultValue)LikegetOrElse(String, Object)but returns a primitive int. The config's value must be aNumberor null or nonexistant.
-
getIntOrElse
default int getIntOrElse(java.util.List<java.lang.String> path, int defaultValue)LikegetOrElse(List, Object)but returns a primitive int. The config's value must be aNumberor null or nonexistant.
-
getIntOrElse
default int getIntOrElse(java.lang.String path, java.util.function.IntSupplier defaultValueSupplier)LikegetOrElse(String, Supplier)but returns a primitive int. The config's value must be aNumberor null or nonexistant.
-
getIntOrElse
default int getIntOrElse(java.util.List<java.lang.String> path, java.util.function.IntSupplier defaultValueSupplier)LikegetOrElse(List, Supplier)but returns a primitive int. The config's value must be aNumberor null or nonexistant.
-
getLong
default long getLong(java.lang.String path)
Likeget(String)but returns a primitive long. The config's value must be aNumber.
-
getLong
default long getLong(java.util.List<java.lang.String> path)
Likeget(List)but returns a primitive long. The config's value must be aNumber.
-
getOptionalLong
default java.util.OptionalLong getOptionalLong(java.lang.String path)
LikegetOptional(String)but returns a primitive long. The config's value must be aNumberor null or nonexistant.
-
getOptionalLong
default java.util.OptionalLong getOptionalLong(java.util.List<java.lang.String> path)
LikegetOptional(List)but returns a primitive long. The config's value must be aNumberor null or nonexistant.
-
getLongOrElse
default long getLongOrElse(java.lang.String path, long defaultValue)LikegetOrElse(String, Object)but returns a primitive long. The config's value must be aNumberor null or nonexistant.
-
getLongOrElse
default long getLongOrElse(java.util.List<java.lang.String> path, long defaultValue)LikegetOrElse(List, Object)but returns a primitive long. The config's value must be aNumberor null or nonexistant.
-
getLongOrElse
default long getLongOrElse(java.lang.String path, java.util.function.LongSupplier defaultValueSupplier)LikegetOrElse(String, Supplier)but returns a primitive long. The config's value must be aNumberor null or nonexistant.
-
getLongOrElse
default long getLongOrElse(java.util.List<java.lang.String> path, java.util.function.LongSupplier defaultValueSupplier)LikegetOrElse(List, Supplier)but returns a primitive long. The config's value must be aNumberor null or nonexistant.
-
getByte
default byte getByte(java.lang.String path)
-
getByte
default byte getByte(java.util.List<java.lang.String> path)
-
getByteOrElse
default byte getByteOrElse(java.lang.String path, byte defaultValue)
-
getByteOrElse
default byte getByteOrElse(java.util.List<java.lang.String> path, byte defaultValue)
-
getShort
default short getShort(java.lang.String path)
-
getShort
default short getShort(java.util.List<java.lang.String> path)
-
getShortOrElse
default short getShortOrElse(java.lang.String path, short defaultValue)
-
getShortOrElse
default short getShortOrElse(java.util.List<java.lang.String> path, short defaultValue)
-
getChar
default char getChar(java.lang.String path)
Returns a char value from the configuration.If the value is a Number, returns
Number.intValue(), cast to char. If the value is a CharSequence, returns its first character. Otherwise, attempts to cast the value to a char.- Parameters:
path- the value's path as a dot-separated String- Returns:
- the value, as a single char
-
getChar
default char getChar(java.util.List<java.lang.String> path)
Returns a char value from the configuration.If the value is a Number, returns
Number.intValue(), cast to char. If the value is a CharSequence, returns its first character. Otherwise, attempts to cast the value to a char.- Parameters:
path- the value's path as a list of String- Returns:
- the value, as a single char
-
getCharOrElse
default char getCharOrElse(java.lang.String path, char defaultValue)Returns a char value from the configuration.If the value is nonexistant, returns defaultValue. If the value is a Number, returns
Number.intValue(), cast to char. If the value is a CharSequence, returns its first character. Otherwise, attempts to cast the value to a char.- Parameters:
path- the value's pathdefaultValue- the char to return if the value doesn't exist in the config- Returns:
- the value, as a single char
-
getCharOrElse
default char getCharOrElse(java.util.List<java.lang.String> path, char defaultValue)Returns a char value from the configuration.If the value is nonexistant, returns defaultValue. If the value is a Number, returns
Number.intValue(), cast to char. If the value is a CharSequence, returns its first character. Otherwise, attempts to cast the value to a char.- Parameters:
path- the value's pathdefaultValue- the char to return if the value doesn't exist in the config- Returns:
- the value, as a single char
-
contains
default boolean contains(java.lang.String path)
Checks if the config contains a value at some path.- Parameters:
path- the path to check, each part separated by a dot. Example "a.b.c"- Returns:
trueif the path is associated with a value,falseif it's not.
-
contains
boolean contains(java.util.List<java.lang.String> path)
Checks if the config contains a value at some path.- Parameters:
path- the path to check, each element of the list is a different part of the path.- Returns:
trueif the path is associated with a value,falseif it's not.
-
isNull
default boolean isNull(java.lang.String path)
Checks if the config contains a null value at some path.- Parameters:
path- the path to check, each part separated by a dot. Example "a.b.c"- Returns:
trueif the path is associated withNullObject.NULL_OBJECT,falseif it's associated with another value or with no value.
-
isNull
default boolean isNull(java.util.List<java.lang.String> path)
Checks if the config contains a null value at some path.- Parameters:
path- the path to check, each element of the list is a different part of the path.- Returns:
trueif the path is associated withNullObject.NULL_OBJECT,falseif it's associated with another value or with no value.
-
size
int size()
Gets the size of the config.- Returns:
- the number of top-level elements in the config.
-
isEmpty
default boolean isEmpty()
Checks if the config is empty.- Returns:
trueif the config is empty,falseif it contains at least one element.
-
valueMap
java.util.Map<java.lang.String,java.lang.Object> valueMap()
Returns a Map view of the config's values. If the config is unmodifiable then the returned map is unmodifiable too.- Returns:
- a Map view of the config's values.
-
entrySet
java.util.Set<? extends UnmodifiableConfig.Entry> entrySet()
Returns a Set view of the config's entries. If the config is unmodifiable then the returned set is unmodifiable too.- Returns:
- a Set view of the config's entries.
-
configFormat
ConfigFormat<?> configFormat()
Returns the config's format.- Returns:
- the config's format
-
apply
default <T> T apply(java.lang.String path)
For scala: gets a config value.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each part separated by a dot. Example "a.b.c"- See Also:
get(String)
-
apply
default <T> T apply(java.util.List<java.lang.String> path)
For scala: gets a config value.- Type Parameters:
T- the value's type- Parameters:
path- the value's path, each element of the list is a different part of the path.- See Also:
get(List)
-
-