public class Property extends Object
Properties
with support
for interpretation of value strings in different formats.Constructor and Description |
---|
Property(String value)
Creates a new property with the value given as a string.
|
Modifier and Type | Method and Description |
---|---|
boolean |
asBoolean()
Interprets the value string as a boolean.
|
double |
asDouble()
Tries to interpret the value as a double.
|
float |
asFloat()
Tries to interpret the value as a float.
|
int |
asInteger()
Tries to interpret the value as an integer.
|
long |
asLong()
Tries to interpret the value as a long integer.
|
String |
asString()
Returns the string representation of the property value.
|
boolean |
equals(Object obj) |
int |
hashCode() |
String |
toString() |
public Property(String value)
value
- value stringpublic String asString()
public boolean asBoolean()
true
if the property value contains a string
indicating true
, else false
public int asInteger()
NumberFormatException
- property value cannot be interpreted as a numberpublic long asLong()
NumberFormatException
- property value cannot be interpreted as a numberpublic float asFloat()
NumberFormatException
- property value cannot be interpreted as a numberpublic double asDouble()
NumberFormatException
- property value cannot be interpreted as a numberCopyright © 2018 CoR-Lab. All rights reserved.