org.n52.security.common.attributes
Class Attribute

java.lang.Object
  extended by org.n52.security.common.attributes.Attribute
All Implemented Interfaces:
java.io.Serializable

public class Attribute
extends java.lang.Object
implements java.io.Serializable

This Class represents an Key-Value-Attribute. It also implements Serializable, but to be it, its value has also to be serializable.

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

Field Summary
protected  java.lang.String m_key
          Field m_key holds the key or name of the attribute.
protected  AttributeValue m_value
          Field m_value holds thee value of this attribute.
 
Constructor Summary
Attribute(java.lang.String key, AttributeValue value)
          Creates an Attribute.
 
Method Summary
 boolean equals(java.lang.Object o)
          Tests for equality.
 java.lang.String getKey()
           
 AttributeValue getValue()
           
 int hashCode()
          Generates a hashcode based of the hashcode of the key and value.
 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_key

protected java.lang.String m_key
Field m_key holds the key or name of the attribute.


m_value

protected AttributeValue m_value
Field m_value holds thee value of this attribute.

See Also:
org.n52.security.common.attributes.AttributeValue}
Constructor Detail

Attribute

public Attribute(java.lang.String key,
                 AttributeValue value)
Creates an Attribute. Both parameters are adopted to be not null. For Attributes with a value of 'null' use AttributeValue.EMPTY_VALUE.

Parameters:
key - the key or name of the attribute
value - the value of the attribute.
Method Detail

getKey

public java.lang.String getKey()
Returns:
Returns the key.

getValue

public AttributeValue getValue()
Returns:
Returns the value.

equals

public boolean equals(java.lang.Object o)
Tests for equality. An attribute equals an other attribute if the key and the value are equal.

Overrides:
equals in class java.lang.Object
Parameters:
o - the test object.
Returns:
true if key and the value equals o's value and key.

hashCode

public int hashCode()
Generates a hashcode based of the hashcode of the key and value.

Overrides:
hashCode in class java.lang.Object
Returns:
a hashcode.

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.


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