public static final class ConfigProperties.Property extends Object implements Serializable
Property
class represents a single property.Constructor and Description |
---|
ConfigProperties.Property(String name,
String type,
Object value)
Create a new property object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Compare this property for equality with another.
|
String |
getName()
Get the name of the property.
|
String |
getType()
Get the Java class type of the property.
|
Object |
getValue()
Get the current value of the property.
|
int |
hashCode()
Get a hash code for this property.
|
void |
setValue(Object value)
Set a new value for the property.
|
static Object |
toObject(String type,
String value)
Utility method to convert the string representation of a value to a value object
of a specified type.
|
String |
toString()
Get a string representation of this property object.
|
public ConfigProperties.Property(String name, String type, Object value) throws IllegalArgumentException
name
- the name of the property.type
- the Java class type of the property.value
- the value of the property. If value
is not null, then
value.getClass().getName().equals(type)
must hold true.NullPointerException
- if name
or type
is null
.IllegalArgumentException
- if value.getClass().getName().equals(type)
is not true.public String getName()
public String getType()
public Object getValue()
null
.public void setValue(Object value) throws IllegalArgumentException
value
- the value of the property. If value
is not null, then
value.getClass().getName().equals(getType())
must hold true.IllegalArgumentException
- if value.getClass().getName().equals(getType())
is not true.public boolean equals(Object obj)
public int hashCode()
public String toString()
public static Object toObject(String type, String value) throws IllegalArgumentException
toObject("java.lang.Integer","5") returns a
java.lang.Integer
object containing the value 5
.
The following types can be converted by this method:
- java.lang.Integer
- java.lang.Long
- java.lang.Double
- java.lang.Float
- java.lang.Short
- java.lang.Byte
- java.lang.Character
- java.lang.Boolean
- java.lang.String
These types are the supported types of SLEE resource adaptor configuration properties,
SBB environment entries, etc.
type
- the type of object to return.value
- a string representation of the value to convert.value
argument.NullPointerException
- if either argument is null
.IllegalArgumentException
- if type
is not supported by this method,
or if value
is not a legal value for the type.