org.n52.security.common.attributes
Class AttributeValueAdapter

java.lang.Object
  extended by org.n52.security.common.attributes.AttributeValueAdapter
All Implemented Interfaces:
java.io.Serializable, AttributeValue
Direct Known Subclasses:
AnyObjectAttributeValue, BooleanAttributeValue, DoubleAttributeValue, IntegerAttributeValue, StringAttributeValue

public abstract class AttributeValueAdapter
extends java.lang.Object
implements AttributeValue, java.io.Serializable

The class AttributeValueAdapter implements all methods of AttributeValue.

It is a helper class for implementing concrete attribute value classes.

Version:
$Revision: 852 $
Author:
Marko Reiprecht
See Also:
Serialized Form

Field Summary
protected  java.lang.Object m_wrappedObject
          The concrete value.
 
Fields inherited from interface org.n52.security.common.attributes.AttributeValue
EMPTY_VALUE
 
Constructor Summary
AttributeValueAdapter(java.lang.Object wrappedObject)
          creates new AttributeValueAdapter.
 
Method Summary
 boolean equals(java.lang.Object o)
          This delegates the equality check to the internal 'wrapped' value.
 java.lang.String getTypeName()
          gets the type name of the concrete value.
 java.lang.Object getUnspecifiedValue()
          Gets the concrete value.
 int hashCode()
          Generates the hashCode of this object.
 java.lang.String toString()
          Generates an informal string.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

m_wrappedObject

protected java.lang.Object m_wrappedObject
The concrete value.

Constructor Detail

AttributeValueAdapter

public AttributeValueAdapter(java.lang.Object wrappedObject)
                      throws java.lang.NullPointerException
creates new AttributeValueAdapter.

Parameters:
wrappedObject - the concrete value object, asserts wrappedObject != null.
Throws:
java.lang.NullPointerException - if wrappedObject is null.
Method Detail

equals

public boolean equals(java.lang.Object o)
This delegates the equality check to the internal 'wrapped' value.

Overrides:
equals in class java.lang.Object
Parameters:
o - the object to test with.
Returns:
true only when o.getUnspecifiedValue().equals(this.getUnspecifiedValue())

hashCode

public int hashCode()
Generates the hashCode of this object. It is forwarded to this.getUnspecifiedValue().hashCode().

Overrides:
hashCode in class java.lang.Object
Returns:
the hashcode for this object.

toString

public java.lang.String toString()
Generates an informal string. This method should only used for logging purposes.

Overrides:
toString in class java.lang.Object
Returns:
a string representation.

getUnspecifiedValue

public java.lang.Object getUnspecifiedValue()
Gets the concrete value.

Specified by:
getUnspecifiedValue in interface AttributeValue
Returns:
the wrapped concrete value.
See Also:
AttributeValue.getUnspecifiedValue()

getTypeName

public java.lang.String getTypeName()
gets the type name of the concrete value. this is a short cut of getUnspecifiedValue().getClass().getName()

Specified by:
getTypeName in interface AttributeValue
Returns:
a type name.
See Also:
AttributeValue.getTypeName()


Copyright © 2004-2009 52north.org. All Rights Reserved.