org.jboss.cache.pojo.impl
Class ReferenceImpl

java.lang.Object
  extended by org.jboss.cache.pojo.impl.ReferenceImpl
All Implemented Interfaces:
java.io.Serializable, Reference

@Immutable
public final class ReferenceImpl
extends java.lang.Object
implements Reference, java.io.Serializable

A reference from an attached object to another attached object. This class also contains the name of the field that contains the reference.

Author:
Dan Berindei
See Also:
Serialized Form

Constructor Summary
ReferenceImpl(org.jboss.cache.Fqn<?> fqn)
           
ReferenceImpl(org.jboss.cache.Fqn<?> fqn, java.lang.String key)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 org.jboss.cache.Fqn<?> getFqn()
          Returns the Fqn of the referring node.
 java.lang.String getKey()
          Returns the name of the node key which references the attached object, or null if the Fqn is a normal alias to the internal node.
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReferenceImpl

public ReferenceImpl(org.jboss.cache.Fqn<?> fqn)

ReferenceImpl

public ReferenceImpl(org.jboss.cache.Fqn<?> fqn,
                     java.lang.String key)
Parameters:
fqn - Fqn of the referring node. Cannot be null.
key - Name of the field, index in the field or key in the collection that is containing the reference.
Method Detail

getKey

public java.lang.String getKey()
Description copied from interface: Reference
Returns the name of the node key which references the attached object, or null if the Fqn is a normal alias to the internal node. If there is a key, then this is typically a field name or collection index.

Specified by:
getKey in interface Reference
Returns:
Name of the field or key/index in the collection that is containing the reference.

getFqn

public org.jboss.cache.Fqn<?> getFqn()
Description copied from interface: Reference
Returns the Fqn of the referring node. Cannot be null.

Specified by:
getFqn in interface Reference
Returns:
Fqn of the referring node.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2011 JBoss, a division of Red Hat. All Rights Reserved.