Package com.tangosol.coherence.rest.util
Class PropertySpec
- java.lang.Object
-
- com.tangosol.coherence.rest.util.PropertySpec
-
- All Implemented Interfaces:
PortableObject,Serializable,Comparable<PropertySpec>
public class PropertySpec extends Object implements Comparable<PropertySpec>, Serializable, PortableObject
Specification for a single property.- Author:
- as 2010.10.11
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Classm_clzPartialClassProperty class (only for partial properties).protected ValueExtractorm_extractorAn extractor that can extract value of this property from a target object.protected PropertySetm_propertySetA set of nested properties.protected Stringm_sNameProperty name.
-
Constructor Summary
Constructors Constructor Description PropertySpec()Default constructor (necessary for deserialization).PropertySpec(String sName)Construct PropertySpec instance.PropertySpec(String sName, PropertySet propertySet)Construct PropertySpec instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(PropertySpec o)Compare this object to another.booleanequals(Object o)Test equality of this object with another.static PropertySpecfromString(String sSpec)Create a PropertySpec from its textual representation.protected ValueExtractorgetExtractor()Return extractor for this property.StringgetName()Return the property name.ClassgetPartialClass()Return the partial class for this property.PropertySetgetPropertySet()Return the set of nested properties.ObjectgetValue(Object oTarget)Extract the value of this property from a target object.inthashCode()Return hash code for this object.booleanisPartial()Return whether this is a partial property or not.voidreadExternal(PofReader reader)Restore the contents of a user type instance by reading its state using the specified PofReader object.voidsetPartialClass(Class clzPartialClass)Set the partial class for this property.StringtoString()Return string representation of this object.voidwriteExternal(PofWriter writer)Save the contents of a POF user type instance by writing its state using the specified PofWriter object.
-
-
-
Field Detail
-
m_sName
protected String m_sName
Property name.
-
m_propertySet
protected PropertySet m_propertySet
A set of nested properties.
-
m_clzPartialClass
protected transient Class m_clzPartialClass
Property class (only for partial properties).
-
m_extractor
protected transient ValueExtractor m_extractor
An extractor that can extract value of this property from a target object.
-
-
Constructor Detail
-
PropertySpec
public PropertySpec()
Default constructor (necessary for deserialization).
-
PropertySpec
public PropertySpec(String sName)
Construct PropertySpec instance.- Parameters:
sName- property name
-
PropertySpec
public PropertySpec(String sName, PropertySet propertySet)
Construct PropertySpec instance.- Parameters:
sName- property namepropertySet- a set of nested properties
-
-
Method Detail
-
fromString
public static PropertySpec fromString(String sSpec)
Create a PropertySpec from its textual representation.- Parameters:
sSpec- property specification as a string- Returns:
- PropertySpec instance
-
getValue
public Object getValue(Object oTarget)
Extract the value of this property from a target object.- Parameters:
oTarget- object to extract the value from- Returns:
- extracted property value, or null if specified property cannot be accessed
-
compareTo
public int compareTo(PropertySpec o)
Compare this object to another.- Specified by:
compareToin interfaceComparable<PropertySpec>- Parameters:
o- object to compare this object with- Returns:
- negative integer if this object is less than a specified object, zero if they are equal, or positive integer if this object is greater than a specified object
-
readExternal
public void readExternal(PofReader reader) throws IOException
Restore the contents of a user type instance by reading its state using the specified PofReader object.- Specified by:
readExternalin interfacePortableObject- Parameters:
reader- the PofReader from which to read the object's state- Throws:
IOException- if an I/O error occurs
-
writeExternal
public void writeExternal(PofWriter writer) throws IOException
Save the contents of a POF user type instance by writing its state using the specified PofWriter object.- Specified by:
writeExternalin interfacePortableObject- Parameters:
writer- the PofWriter to which to write the object's state- Throws:
IOException- if an I/O error occurs
-
equals
public boolean equals(Object o)
Test equality of this object with another.
-
hashCode
public int hashCode()
Return hash code for this object.
-
toString
public String toString()
Return string representation of this object.
-
getName
public String getName()
Return the property name.- Returns:
- the property name
-
getPropertySet
public PropertySet getPropertySet()
Return the set of nested properties.- Returns:
- nested properties
-
isPartial
public boolean isPartial()
Return whether this is a partial property or not.- Returns:
- true if this is a partial property, false otherwise
-
getPartialClass
public Class getPartialClass()
Return the partial class for this property.- Returns:
- partial class for this property, or null if this is not a partial property
-
setPartialClass
public void setPartialClass(Class clzPartialClass)
Set the partial class for this property.- Parameters:
clzPartialClass- class of this property
-
getExtractor
protected ValueExtractor getExtractor()
Return extractor for this property.- Returns:
- an extractor
-
-