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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ClassProperty class (only for partial properties).protected ValueExtractorAn extractor that can extract value of this property from a target object.protected PropertySetA set of nested properties.protected StringProperty name. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor (necessary for deserialization).PropertySpec(String sName) Construct PropertySpec instance.PropertySpec(String sName, PropertySet propertySet) Construct PropertySpec instance. -
Method Summary
Modifier and TypeMethodDescriptionintCompare this object to another.booleanTest equality of this object with another.static PropertySpecfromString(String sSpec) Create a PropertySpec from its textual representation.protected ValueExtractorReturn extractor for this property.getName()Return the property name.Return the partial class for this property.Return the set of nested properties.Extract the value of this property from a target object.inthashCode()Return hash code for this object.booleanReturn 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.toString()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 Details
-
m_sName
Property name. -
m_propertySet
A set of nested properties. -
m_clzPartialClass
Property class (only for partial properties). -
m_extractor
An extractor that can extract value of this property from a target object.
-
-
Constructor Details
-
PropertySpec
public PropertySpec()Default constructor (necessary for deserialization). -
PropertySpec
Construct PropertySpec instance.- Parameters:
sName- property name
-
PropertySpec
Construct PropertySpec instance.- Parameters:
sName- property namepropertySet- a set of nested properties
-
-
Method Details
-
fromString
Create a PropertySpec from its textual representation.- Parameters:
sSpec- property specification as a string- Returns:
- PropertySpec instance
-
getValue
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
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
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
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
Test equality of this object with another. -
hashCode
public int hashCode()Return hash code for this object. -
toString
Return string representation of this object. -
getName
Return the property name.- Returns:
- the property name
-
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
Return the partial class for this property.- Returns:
- partial class for this property, or null if this is not a partial property
-
setPartialClass
Set the partial class for this property.- Parameters:
clzPartialClass- class of this property
-
getExtractor
Return extractor for this property.- Returns:
- an extractor
-