public class PropertySet<T> extends Object implements Iterable<PropertySpec>, ValueExtractor<T,Object>, ExternalizableLite, PortableObject
Each extracted property is returned as a PartialObject
instance,
which is an instance of a dynamically generated class containing only
properties defined in this PropertySet.
Modifier and Type | Field and Description |
---|---|
protected SortedSet<PropertySpec> |
m_setProperties
Property set.
|
Constructor and Description |
---|
PropertySet()
Default constructor.
|
PropertySet(PropertySpec... aProperties)
Construct a PropertySet instance.
|
PropertySet(Set<PropertySpec> setProperties)
Construct a PropertySet instance.
|
Modifier and Type | Method and Description |
---|---|
void |
add(PropertySpec property)
Add a property to this property set.
|
boolean |
equals(Object o)
Test equality of this object with another.
|
Collection<Object> |
extract(Collection<? extends T> colSource)
Extract a collection of partial objects.
|
Object[] |
extract(Object[] aSource)
Extract an array of partial objects.
|
Object |
extract(T source)
Extract a partial object from a source object.
|
protected PropertySpec |
first()
Return the first property in this PropertySet.
|
static PropertySet |
fromString(String sPropertySet)
Create a PropertySet from its textual representation.
|
protected SortedSet<PropertySpec> |
getProperties()
Return the internal property set.
|
int |
hashCode()
Return hash code for this object.
|
Iterator<PropertySpec> |
iterator()
Return an iterator for this property set.
|
void |
readExternal(DataInput in)
Restore the contents of this object by loading the object's state from
the passed DataInput object.
|
void |
readExternal(PofReader reader)
Restore the contents of a user type instance by reading its state using
the specified PofReader object.
|
String |
toString()
Return string representation of this object.
|
void |
writeExternal(DataOutput out)
Save the contents of this object by storing the object's state into
the passed DataOutput object.
|
void |
writeExternal(PofWriter writer)
Save the contents of a POF user type instance by writing its state using
the specified PofWriter object.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
andThen, apply, applyAsDouble, applyAsInt, applyAsLong, compose, fromKey, getCanonicalName, getTarget, identity, identityCast, of
andThen, compose
protected final SortedSet<PropertySpec> m_setProperties
public PropertySet()
public PropertySet(PropertySpec... aProperties)
aProperties
- an array of property specificationspublic PropertySet(Set<PropertySpec> setProperties)
setProperties
- a set of property specificationspublic static PropertySet fromString(String sPropertySet)
sPropertySet
- property set descriptorpublic void add(PropertySpec property)
property
- property to addpublic Collection<Object> extract(Collection<? extends T> colSource)
colSource
- collection of source objectspublic Object[] extract(Object[] aSource)
aSource
- an array of source objectspublic Object extract(T source)
extract
in interface ValueExtractor<T,Object>
source
- the source objectpublic Iterator<PropertySpec> iterator()
iterator
in interface Iterable<PropertySpec>
public void readExternal(DataInput in) throws IOException
readExternal
in interface ExternalizableLite
in
- the DataInput stream to read data from in order to restore
the state of this objectIOException
- if an I/O exception occursNotActiveException
- if the object is not in its initial
state, and therefore cannot be deserialized intopublic void writeExternal(DataOutput out) throws IOException
writeExternal
in interface ExternalizableLite
out
- the DataOutput stream to write the state of this object toIOException
- if an I/O exception occurspublic void readExternal(PofReader reader) throws IOException
readExternal
in interface PortableObject
reader
- the PofReader from which to read the object's stateIOException
- if an I/O error occurspublic void writeExternal(PofWriter writer) throws IOException
writeExternal
in interface PortableObject
writer
- the PofWriter to which to write the object's stateIOException
- if an I/O error occurspublic boolean equals(Object o)
public int hashCode()
public String toString()
protected PropertySpec first()
protected SortedSet<PropertySpec> getProperties()