Interface UnmodifiableConfig.Entry
-
- All Known Subinterfaces:
CommentedConfig.Entry,Config.Entry,UnmodifiableCommentedConfig.Entry
- All Known Implementing Classes:
AbstractCommentedConfig.CommentedEntryWrapper,AbstractConfig.EntryWrapper
- Enclosing interface:
- UnmodifiableConfig
public static interface UnmodifiableConfig.EntryAn unmodifiable config entry.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default bytegetByte()default bytegetByteOrElse(byte defaultValue)default chargetChar()If the value is a Number, returnsNumber.intValue(), cast to char.default chargetCharOrElse(char defaultValue)default intgetInt()default intgetIntOrElse(int defaultValue)java.lang.StringgetKey()default longgetLong()default longgetLongOrElse(long defaultValue)default <T> java.util.Optional<T>getOptional()default java.util.OptionalIntgetOptionalInt()default java.util.OptionalLonggetOptionalLong()default <T> TgetOrElse(T defaultValue)<T> TgetRawValue()Returns the entry's value without convertingNullObject.NULL_OBJECTtonull.default shortgetShort()default shortgetShortOrElse(short defaultValue)default <T> TgetValue()default booleanisNull()
-
-
-
Method Detail
-
getKey
java.lang.String getKey()
- Returns:
- the entry's key
-
getRawValue
<T> T getRawValue()
Returns the entry's value without convertingNullObject.NULL_OBJECTtonull.- Type Parameters:
T- the value's type- Returns:
- the entry's value
-
getValue
default <T> T getValue()
- Type Parameters:
T- the value's type- Returns:
- the entry's value
-
isNull
default boolean isNull()
- Returns:
trueif the value isNullObject.NULL_OBJECT.
-
getOptional
default <T> java.util.Optional<T> getOptional()
- Type Parameters:
T- the value's type- Returns:
- the entry's value, wrapped in
Optional
-
getOrElse
default <T> T getOrElse(T defaultValue)
-
getInt
default int getInt()
- Returns:
- the entry's value as an int
-
getOptionalInt
default java.util.OptionalInt getOptionalInt()
-
getIntOrElse
default int getIntOrElse(int defaultValue)
-
getLong
default long getLong()
- Returns:
- the entry's value as a long
-
getOptionalLong
default java.util.OptionalLong getOptionalLong()
-
getLongOrElse
default long getLongOrElse(long defaultValue)
-
getByte
default byte getByte()
- Returns:
- the entry's value as a byte
-
getByteOrElse
default byte getByteOrElse(byte defaultValue)
-
getShort
default short getShort()
- Returns:
- the entry's value as a short
-
getShortOrElse
default short getShortOrElse(short defaultValue)
-
getChar
default char getChar()
If the value is a Number, returnsNumber.intValue(), cast to char. If the value is a CharSequence, returns its first character. Otherwise, attempts to cast the value to a char.- Returns:
- the entry's value as a char
-
getCharOrElse
default char getCharOrElse(char defaultValue)
-
-