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 Details

    • 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 Details

    • 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 name
      propertySet - a set of nested properties
  • Method Details

    • 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:
      compareTo in interface Comparable<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:
      readExternal in interface PortableObject
      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:
      writeExternal in interface PortableObject
      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.
      Overrides:
      equals in class Object
      Parameters:
      o - object to compare this object with
      Returns:
      true if this object is equal to the specified object
    • hashCode

      public int hashCode()
      Return hash code for this object.
      Overrides:
      hashCode in class Object
      Returns:
      hash code
    • toString

      public String toString()
      Return string representation of this object.
      Overrides:
      toString in class Object
      Returns:
      this object as a String
    • 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