org.qi4j.api.property
Class AbstractPropertyInstance<T>

java.lang.Object
  extended by org.qi4j.api.property.AbstractPropertyInstance<T>
All Implemented Interfaces:
Property<T>, PropertyInfo
Direct Known Subclasses:
ComputedPropertyInstance

public abstract class AbstractPropertyInstance<T>
extends Object
implements Property<T>

AbstractPropertyInstance is the base implementation of Property.


Field Summary
protected  PropertyInfo propertyInfo
           
 
Constructor Summary
protected AbstractPropertyInstance(PropertyInfo aPropertyInfo)
          Construct an instance of ComputedPropertyInstance.
 
Method Summary
 boolean equals(Object o)
          Perform equals with o argument.
 int hashCode()
          Calculate hash code.
 boolean isComputed()
           
 boolean isImmutable()
           
<V> V
metaInfo(Class<V> anInfoType)
          Returns the property info given anInfoType argument.
 QualifiedName qualifiedName()
          Returns the qualified name of this Property.
 Type type()
          Get the type of the property.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.qi4j.api.property.Property
get, set
 

Field Detail

propertyInfo

protected final PropertyInfo propertyInfo
Constructor Detail

AbstractPropertyInstance

protected AbstractPropertyInstance(PropertyInfo aPropertyInfo)
                            throws IllegalArgumentException
Construct an instance of ComputedPropertyInstance.

Parameters:
aPropertyInfo - The property info. This argument must not be null.
Throws:
IllegalArgumentException - Thrown if the specified aPropertyInfo argument is null.
Method Detail

metaInfo

public final <V> V metaInfo(Class<V> anInfoType)
Returns the property info given anInfoType argument.

Specified by:
metaInfo in interface PropertyInfo
Parameters:
anInfoType - The info type.
Returns:
Property info given anInfoType argument.

qualifiedName

public final QualifiedName qualifiedName()
Returns the qualified name of this Property. Must not return null.

Specified by:
qualifiedName in interface PropertyInfo
Returns:
The qualified name of this Property.

type

public final Type type()
Description copied from interface: PropertyInfo
Get the type of the property. If the property is declared as Property then X is returned.

Specified by:
type in interface PropertyInfo
Returns:
the property type

isImmutable

public boolean isImmutable()
Specified by:
isImmutable in interface PropertyInfo

isComputed

public boolean isComputed()
Specified by:
isComputed in interface PropertyInfo

equals

public boolean equals(Object o)
Perform equals with o argument.

The definition of equals() for the ComputedProperty is that if the Value, subclass and all the metaInfo are equal, then th

Overrides:
equals in class Object
Parameters:
o - The other object to compare.
Returns:
Returns a boolean indicator whether this object is equals the other.

hashCode

public int hashCode()
Calculate hash code.

Overrides:
hashCode in class Object
Returns:
the hashcode of this ComputedPropertyInstance instance.