- All Known Subinterfaces:
- DefaultValueGetter
- All Known Implementing Classes:
- JsonPrimitive,- Property,- XmlAttribute,- XmlValue
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A functional interface that provides methods to get a value of a specific type.
The value is hold by the object that implements this interface.
 
 
The value is hold by the object that implements this interface.
     The interface is functional because it has only one abstract method getAsString().
     All other methods rely on this method to get the value as a string and then parse it to the desired type.
     The getAsString() method must bei implemented correctly, or the other methods will not work as expected.
 
- getAsBoolean()to get the value as a boolean
- getAsNumber()to get the value as a number
- getAsByte()to get the value as a byte
- getAsShort()to get the value as a short
- getAsInteger()to get the value as an integer
- getAsLong()to get the value as a long
- getAsFloat()to get the value as a float
- getAsDouble()to get the value as a double
- getAs(ThrowableFunction)to get the value as the result of the given parser
- 
Method SummaryModifier and TypeMethodDescriptiondefault <T> TgetAs(@NotNull ThrowableFunction<String, T, ? extends Exception> parser) Returns the value which is hold by this object as the result of the given parser.
 The parser must not be able to handle null values.
 In the case the parser is not able to parse the value, it should not return null, it should throw an exception.default booleanReturns the value which is hold by this object as a boolean.default byteReturns the value which is hold by this object as a byte.default doubleReturns the value which is hold by this object as a double.default floatReturns the value which is hold by this object as a float.default intReturns the value which is hold by this object as an integer.default longReturns the value which is hold by this object as a long.default @NotNull NumberReturns the value which is hold by this object as a number.default shortReturns the value which is hold by this object as a short.@NotNull StringReturns the value which is hold by this object as a string.
- 
Method Details- 
getAsStringReturns the value which is hold by this object as a string.- Returns:
- The value as a string
 
- 
getAsBooleandefault boolean getAsBoolean()Returns the value which is hold by this object as a boolean.- Returns:
- The value as a boolean
- Throws:
- IllegalArgumentException- If the value is not a boolean (e.g. not "true" or "false")
 
- 
getAsNumberReturns the value which is hold by this object as a number.- Returns:
- The value as a number
- Throws:
- IllegalArgumentException- If the value is not a number
 
- 
getAsBytedefault byte getAsByte()Returns the value which is hold by this object as a byte.- Returns:
- The value as a byte
- Throws:
- IllegalArgumentException- If the value is not a byte
 
- 
getAsShortdefault short getAsShort()Returns the value which is hold by this object as a short.- Returns:
- The value as a short
- Throws:
- IllegalArgumentException- If the value is not a short
 
- 
getAsIntegerdefault int getAsInteger()Returns the value which is hold by this object as an integer.- Returns:
- The value as an integer
- Throws:
- IllegalArgumentException- If the value is not an integer
 
- 
getAsLongdefault long getAsLong()Returns the value which is hold by this object as a long.- Returns:
- The value as a long
- Throws:
- IllegalArgumentException- If the value is not a long
 
- 
getAsFloatdefault float getAsFloat()Returns the value which is hold by this object as a float.- Returns:
- The value as a float
- Throws:
- IllegalArgumentException- If the value is not a float
 
- 
getAsDoubledefault double getAsDouble()Returns the value which is hold by this object as a double.- Returns:
- The value as a double
- Throws:
- IllegalArgumentException- If the value is not a double
 
- 
getAs@NotNull default <T> T getAs(@NotNull @NotNull ThrowableFunction<String, T, ? extends Exception> parser) Returns the value which is hold by this object as the result of the given parser.
 The parser must not be able to handle null values.
 In the case the parser is not able to parse the value, it should not return null, it should throw an exception.- Type Parameters:
- T- The type of the parsed value
- Parameters:
- parser- The parser to parse the value
- Returns:
- The value as the result of the parser
- Throws:
- NullPointerException- If the parser is null
- IllegalArgumentException- If the value could not be parsed
 
 
-