public class PropertyData<T>
extends java.lang.Object
PropertyData represents Property Type @see JmxConstants.PROPERTY_TYPE
. It is a codec for the
CompositeData
representing a Property with an associated Type and Value.
Modifier and Type | Method and Description |
---|---|
static <T> PropertyData<T> |
from(javax.management.openmbean.CompositeData compositeData)
Constructs a
PropertyData object from the given CompositeData |
java.lang.String |
getEncodedType() |
java.lang.String |
getEncodedValue() |
java.lang.String |
getKey() |
T |
getValue() |
boolean |
isEncodingPrimitive() |
static PropertyData<java.lang.Boolean> |
newInstance(java.lang.String key,
boolean value)
Static factory method for
PropertyData instance which preserves encoded type
information for primitive boolean type |
static PropertyData<java.lang.Byte> |
newInstance(java.lang.String key,
byte value)
Static factory method for
PropertyData instance which preserves encoded type
information for primitive byte type |
static PropertyData<java.lang.Character> |
newInstance(java.lang.String key,
char value)
Static factory method for
PropertyData instance which preserves encoded type
information for primitive char type |
static PropertyData<java.lang.Double> |
newInstance(java.lang.String key,
double value)
Static factory method for
PropertyData instance which preserves encoded type
information for primitive double type |
static PropertyData<java.lang.Float> |
newInstance(java.lang.String key,
float value)
Static factory method for
PropertyData instance which preserves encoded type
information for primitive float type |
static PropertyData<java.lang.Integer> |
newInstance(java.lang.String key,
int value)
Static factory method for
PropertyData instance which preserves encoded type
information for primitive int type |
static PropertyData<java.lang.Long> |
newInstance(java.lang.String key,
long value)
Static factory method for
PropertyData instance which preserves encoded type
information for primitive long type |
static <T> PropertyData<T> |
newInstance(java.lang.String key,
T value)
Static factory method for
PropertyData instance parameterized by value's type |
javax.management.openmbean.CompositeData |
toCompositeData()
Returns CompositeData representing a Property typed by
JmxConstants.PROPERTY_TYPE . |
public static <T> PropertyData<T> newInstance(java.lang.String key, T value) throws java.lang.IllegalArgumentException
PropertyData
instance parameterized by value's typeT
- key
- value
- an instance of JmxConstants.SCALAR
java.lang.IllegalArgumentException
- if key or value are null or value's type cannot be encodedpublic static PropertyData<java.lang.Integer> newInstance(java.lang.String key, int value) throws java.lang.IllegalArgumentException
PropertyData
instance which preserves encoded type
information for primitive int typekey
- value
- java.lang.IllegalArgumentException
- if key or value are null or value's type cannot be encodedpublic static PropertyData<java.lang.Long> newInstance(java.lang.String key, long value) throws java.lang.IllegalArgumentException
PropertyData
instance which preserves encoded type
information for primitive long typekey
- value
- java.lang.IllegalArgumentException
- if key or value are null or value's type cannot be encodedpublic static PropertyData<java.lang.Float> newInstance(java.lang.String key, float value) throws java.lang.IllegalArgumentException
PropertyData
instance which preserves encoded type
information for primitive float typekey
- value
- java.lang.IllegalArgumentException
- if key or value are null or value's type cannot be encodedpublic static PropertyData<java.lang.Double> newInstance(java.lang.String key, double value) throws java.lang.IllegalArgumentException
PropertyData
instance which preserves encoded type
information for primitive double typekey
- value
- java.lang.IllegalArgumentException
- if key or value are null or value's type cannot be encodedpublic static PropertyData<java.lang.Byte> newInstance(java.lang.String key, byte value) throws java.lang.IllegalArgumentException
PropertyData
instance which preserves encoded type
information for primitive byte typekey
- value
- java.lang.IllegalArgumentException
- if key or value are null or value's type cannot be encodedpublic static PropertyData<java.lang.Character> newInstance(java.lang.String key, char value) throws java.lang.IllegalArgumentException
PropertyData
instance which preserves encoded type
information for primitive char typekey
- value
- java.lang.IllegalArgumentException
- if key or value are null or value's type cannot be encodedpublic static PropertyData<java.lang.Boolean> newInstance(java.lang.String key, boolean value) throws java.lang.IllegalArgumentException
PropertyData
instance which preserves encoded type
information for primitive boolean typekey
- value
- java.lang.IllegalArgumentException
- if key or value are null or value's type cannot be encodedpublic javax.management.openmbean.CompositeData toCompositeData()
JmxConstants.PROPERTY_TYPE
.public static <T> PropertyData<T> from(javax.management.openmbean.CompositeData compositeData) throws java.lang.IllegalArgumentException
PropertyData
object from the given CompositeData
compositeData
- IlleglArgumentException
- if compositeData is null or not of type JmxConstants.PROPERTY_TYPE
java.lang.IllegalArgumentException
public java.lang.String getKey()
public T getValue()
public java.lang.String getEncodedType()
public java.lang.String getEncodedValue()
public boolean isEncodingPrimitive()
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"