public class PropertyValue extends Object
Represents a property value.
Constructor and Description |
---|
PropertyValue(boolean value)
Initializes a new instance of the
PropertyValue class with a boolean value. |
PropertyValue(byte[] values)
Initializes a new instance of the
PropertyValue class with a byte array. |
PropertyValue(Date value)
Initializes a new instance of the
PropertyValue class with a DateTime value. |
PropertyValue(double value)
Initializes a new instance of the
PropertyValue class with a double value. |
PropertyValue(double[] values)
Initializes a new instance of the
PropertyValue class with an array of double values. |
PropertyValue(int value)
Initializes a new instance of the
PropertyValue class with an integer value. |
PropertyValue(int[] values)
Initializes a new instance of the
PropertyValue class with an array of integer values. |
PropertyValue(long value)
Initializes a new instance of the
PropertyValue class with a long value. |
PropertyValue(long[] values)
Initializes a new instance of the
PropertyValue class with an array of long values. |
PropertyValue(String value)
Initializes a new instance of the
PropertyValue class with a string value. |
PropertyValue(String[] values)
Initializes a new instance of the
PropertyValue class with a string array. |
Modifier and Type | Method and Description |
---|---|
void |
acceptValue(ValueAcceptor valueAcceptor)
Extracts the property value using a custom ValueAcceptor.
|
Object |
getRawValue()
Gets the raw value.
|
MetadataPropertyType |
getType()
Gets the
MetadataPropertyType . |
<TElement> TElement[] |
toArray(Class<TElement> elementType)
Converts the property value to an array of the specified type.
|
<T> T |
toClass(Class<T> type)
Converts the property value to a reference type.
|
String |
toString()
Returns a string that represents the property value.
|
public PropertyValue(int value)
Initializes a new instance of the PropertyValue
class with an integer value.
value
- An int
value.public PropertyValue(long value)
Initializes a new instance of the PropertyValue
class with a long value.
value
- A long
value.public PropertyValue(boolean value)
Initializes a new instance of the PropertyValue
class with a boolean value.
value
- A bool
value.public PropertyValue(double value)
Initializes a new instance of the PropertyValue
class with a double value.
value
- A double
value.public PropertyValue(String value)
Initializes a new instance of the PropertyValue
class with a string value.
value
- A string
value.public PropertyValue(Date value)
Initializes a new instance of the PropertyValue
class with a DateTime
value.
value
- A DateTime
value.public PropertyValue(String[] values)
Initializes a new instance of the PropertyValue
class with a string array.
values
- A string array.public PropertyValue(byte[] values)
Initializes a new instance of the PropertyValue
class with a byte array.
values
- A byte array.public PropertyValue(double[] values)
Initializes a new instance of the PropertyValue
class with an array of double values.
values
- An array of double values.public PropertyValue(int[] values)
Initializes a new instance of the PropertyValue
class with an array of integer values.
values
- An array of integer values.public PropertyValue(long[] values)
Initializes a new instance of the PropertyValue
class with an array of long values.
values
- An array of long values.public final MetadataPropertyType getType()
Gets the MetadataPropertyType
.
public final Object getRawValue()
Gets the raw value.
public final <TElement> TElement[] toArray(Class<TElement> elementType)
Converts the property value to an array of the specified type.
TElement
: The type of an element.
public final <T> T toClass(Class<T> type)
Converts the property value to a reference type.
T
: The exact type to convert to.
public String toString()
Returns a string that represents the property value.
public void acceptValue(ValueAcceptor valueAcceptor)
Extracts the property value using a custom ValueAcceptor.
valueAcceptor
- An acceptor that extracts the value.