public class ValueLine extends Line implements IBasicValue
| Modifier and Type | Field and Description |
|---|---|
protected Object |
cached |
protected String |
value |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
boolean |
getBoolean()
Gets the value of this line as a boolean.
If this line is not a boolean, this will return false. |
boolean |
getBoolean(boolean def)
Gets the value of this line as a boolean.
If this line is not a boolean, this will return def. |
byte |
getByte()
Gets the value of this line as a byte.
If this line is not a byte, this will return 0. |
byte |
getByte(byte def)
Gets the value of this line as a byte.
If this line is not a byte, this will return def. |
char |
getChar()
Gets the value of this line as a char.
If this line is not a char, this will return ' ' (null character). |
char |
getChar(char def)
Gets the value of this line as a char.
If this line is not a char, this will return def. |
protected IConverter |
getConverter() |
double |
getDouble()
Gets the value of this line as a double.
If this line is not a double, this will return 0. |
double |
getDouble(double def)
Gets the value of this line as a double.
If this line is not a double, this will return def. |
float |
getFloat()
Gets the value of this line as a float.
If this line is not a float, this will return 0. |
float |
getFloat(float def)
Gets the value of this line as a float.
If this line is not a float, this will return def. |
int |
getInt()
Gets the value of this line as an int.
If this line is not an int, this will return 0. |
int |
getInt(int def)
Gets the value of this line as a int.
If this line is not a int, this will return def. |
protected int |
getLevel() |
long |
getLong()
Gets the value of this line as a long.
If this line is not a long, this will return 0. |
long |
getLong(long def)
Gets the value of this line as a long.
If this line is not a long, this will return def. |
String |
getName()
Returns the name of this line.
The specific meaning differs between the different types of lines. |
Object |
getObject()
Gets the value of this line and converts it to the most applicable type.
|
short |
getShort()
Gets the value of this line as a short.
If this line is not a short, this will return 0. |
short |
getShort(short def)
Gets the value of this line as a short.
If this line is not a short, this will return def. |
String |
getString()
Gets the value of this line as a String.
|
<T> T |
getT(Class<T> clazz)
Gets the value of this line as an instance of the given class.
If this line is not an instance of the given class, this will return null. |
<T> T |
getT(T def,
Class<T> clazz)
Gets the value of this line as an instance of the given class.
If this line is not an instance of the given class, this will return def. |
int |
hashCode() |
boolean |
isBoolean() |
boolean |
isByte() |
boolean |
isChar() |
boolean |
isDouble() |
boolean |
isFloat() |
boolean |
isInt() |
boolean |
isLong() |
boolean |
isShort() |
boolean |
isString() |
<T> boolean |
isT(Class<T> clazz) |
void |
setValue(Object value)
Set the value of this line to the given object.
If the given object is a String with colors, the colors are replaced with their color codes. If the given object is a Location, it is saved properly. |
String |
toSave() |
StringBuilder |
toSave(StringBuilder b) |
String |
toString() |
public ValueLine(String path, String value)
path - - The path of this ValueLinevalue - - The value of this ValueLineIllegalArgumentException - If path is null, empty or ends with a dot.public final byte getByte()
IBasicValuegetByte in interface IBasicValuepublic final byte getByte(byte def)
IBasicValuegetByte in interface IBasicValuedef - - The byte that will be returned if the value is not a byte.public final boolean isByte()
isByte in interface IBasicValuepublic final short getShort()
IBasicValuegetShort in interface IBasicValuepublic final short getShort(short def)
IBasicValuegetShort in interface IBasicValuedef - - The short that will be returned if the value is not a short.public final boolean isShort()
isShort in interface IBasicValuepublic final int getInt()
IBasicValuegetInt in interface IBasicValuepublic final int getInt(int def)
IBasicValuegetInt in interface IBasicValuedef - - The int that will be returned if the value is not a int.public final boolean isInt()
isInt in interface IBasicValuepublic final long getLong()
IBasicValuegetLong in interface IBasicValuepublic final long getLong(long def)
IBasicValuegetLong in interface IBasicValuedef - - The long that will be returned if the value is not a long.public final boolean isLong()
isLong in interface IBasicValuepublic final float getFloat()
IBasicValuegetFloat in interface IBasicValuepublic final float getFloat(float def)
IBasicValuegetFloat in interface IBasicValuedef - - The float that will be returned if the value is not a float.public final boolean isFloat()
isFloat in interface IBasicValuepublic final double getDouble()
IBasicValuegetDouble in interface IBasicValuepublic final double getDouble(double def)
IBasicValuegetDouble in interface IBasicValuedef - - The double that will be returned if the value is not a double.public final boolean isDouble()
isDouble in interface IBasicValuepublic final boolean getBoolean()
IBasicValuegetBoolean in interface IBasicValuepublic final boolean getBoolean(boolean def)
IBasicValuegetBoolean in interface IBasicValuedef - - The boolean that will be returned if the value is not a boolean.public final boolean isBoolean()
isBoolean in interface IBasicValuepublic final char getChar()
IBasicValuegetChar in interface IBasicValuepublic final char getChar(char def)
IBasicValuegetChar in interface IBasicValuedef - - The char that will be returned if the value is not a char.public final boolean isChar()
isChar in interface IBasicValuepublic String getString()
IBasicValuegetString in interface IBasicValuepublic boolean isString()
isString in interface IBasicValuepublic final Object getObject()
IBasicValuegetObject in interface IBasicValuepublic final <T> T getT(Class<T> clazz)
IBasicValuegetT in interface IBasicValueclazz - - The class of the type to get.public <T> T getT(T def,
Class<T> clazz)
IBasicValuegetT in interface IBasicValuedef - - The object that will be returned if the value is not an instance of the given class.clazz - - The class of the type to get.public <T> boolean isT(Class<T> clazz)
isT in interface IBasicValuepublic final void setValue(Object value)
protected IConverter getConverter()
public final StringBuilder toSave(StringBuilder b)
protected int getLevel()
public String getName()
LineCommentLine - nullEmptyLine - nullCopyright © 2014. All rights reserved.