public class Property extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Property.Type |
Constructor and Description |
---|
Property() |
Property(String name,
String[] values,
Property.Type type) |
Property(String name,
String value,
Property.Type type) |
Modifier and Type | Method and Description |
---|---|
boolean |
getBoolean(boolean _default)
Returns the value in this property as a boolean,
if the value is not a valid boolean, it will return the
provided default.
|
boolean[] |
getBooleanList()
Returns the boolean value of all values that can
be parsed in the list.
|
double |
getDouble(double _default)
Returns the value in this property as a double,
if the value is not a valid double, it will return the
provided default.
|
double[] |
getDoubleList()
Returns the double value of all values that can
be parsed in the list.
|
int |
getInt()
Returns the value in this property as an integer,
if the value is not a valid integer, it will return -1.
|
int |
getInt(int _default)
Returns the value in this property as an integer,
if the value is not a valid integer, it will return the
provided default.
|
int[] |
getIntList()
Returns the integer value of all values that can
be parsed in the list.
|
String |
getName() |
String |
getString()
Returns the value in this property as it's raw string.
|
String[] |
getStringList() |
Property.Type |
getType() |
boolean |
hasChanged() |
boolean |
isBooleanList()
Checks if all of current values stored in this property can be converted to a boolean.
|
boolean |
isBooleanValue()
Checks if the current value held by this property is a valid boolean value.
|
boolean |
isDoubleList()
Checks if all of the current values stored in this property can be converted to a double.
|
boolean |
isDoubleValue()
Checks if the current value held by this property is a valid double value.
|
boolean |
isIntList()
Checks if all of the current values stored in this property can be converted to an integer.
|
boolean |
isIntValue()
Checks if the current value stored in this property can be converted to an integer.
|
boolean |
isList() |
void |
set(boolean value) |
void |
set(double value) |
void |
set(int value) |
void |
set(String value) |
void |
set(String[] values) |
void |
setName(String name) |
boolean |
wasRead()
Determines if this config value was just created, or if it was read from the config file.
|
public String comment
public Property()
public Property(String name, String value, Property.Type type)
public Property(String name, String[] values, Property.Type type)
public String getString()
public int getInt()
public int getInt(int _default)
_default
- The default to provide if the current value is not a valid integerpublic boolean isIntValue()
public boolean getBoolean(boolean _default)
_default
- The default to providepublic boolean isBooleanValue()
public boolean isDoubleValue()
public double getDouble(double _default)
_default
- The default to provide if the current value is not a valid doublepublic String[] getStringList()
public int[] getIntList()
public boolean isIntList()
public boolean[] getBooleanList()
public boolean isBooleanList()
public double[] getDoubleList()
public boolean isDoubleList()
public String getName()
public void setName(String name)
public boolean wasRead()
public Property.Type getType()
public boolean isList()
public boolean hasChanged()
public void set(String value)
public void set(String[] values)
public void set(int value)
public void set(boolean value)
public void set(double value)