org.n52.security.common.attributes
Class AttributeValueAdapter

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

public abstract class AttributeValueAdapter
extends Object
implements AttributeValue, Serializable

Base implementation of AttributeValue.

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

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

Field Summary
protected  Object m_wrappedObject
          The concrete value.
 
Fields inherited from interface org.n52.security.common.attributes.AttributeValue
EMPTY_VALUE
 
Constructor Summary
AttributeValueAdapter(Object wrappedObject)
          creates new AttributeValueAdapter.
 
Method Summary
 boolean equals(Object o)
          This delegates the equality check to the internal 'wrapped' value.
 String getTypeName()
          gets the type name of the concrete value.
 Object getUnspecifiedValue()
          Gets the concrete value.
 int hashCode()
          Generates the hashCode of this object.
 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 Object m_wrappedObject
The concrete value.

Constructor Detail

AttributeValueAdapter

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

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

equals

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

Overrides:
equals in class 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 Object
Returns:
the hashcode for this object.

toString

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

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

getUnspecifiedValue

public Object getUnspecifiedValue()
Gets the concrete value.

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

getTypeName

public 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–2013 52north.org. All rights reserved.