Clearspace API (1.7.0) Core Javadocs

com.jivesoftware.community
Class EntityDescriptor

java.lang.Object
  extended by com.jivesoftware.community.EntityDescriptor
All Implemented Interfaces:
com.jivesoftware.community.cache.Cacheable, com.tangosol.io.ExternalizableLite, java.io.Serializable

public class EntityDescriptor
extends java.lang.Object
implements com.jivesoftware.community.cache.Cacheable, com.tangosol.io.ExternalizableLite

An object that describes a specific entity. An entity is an object of the system, such as a user, group, document, blog, thread, etc.

This class simply holds information about the entity which includes its ID and type. The type of an entity is an int constant from the JiveConstants class.

Note, there is no reference to the actual object this entity describes. This merely holds the most basic information about the object. Given the ID and type the actual object can be loaded from the system (typically from a Manager or Factory class).

See Also:
Serialized Form

Constructor Summary
EntityDescriptor()
          No args constructor for serialization
EntityDescriptor(long id, int type)
          Creates a new descripter given an ID and type.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 int getCachedSize()
           
 long getID()
          Returns the ID of this entity (object).
 int getType()
          Returns the type of object this is.
 int hashCode()
           
 boolean isValid()
          Returns true if this entity descriptor references a valid object.
 void readExternal(java.io.DataInput dataInput)
           
 void writeExternal(java.io.DataOutput dataOutput)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityDescriptor

public EntityDescriptor()
No args constructor for serialization


EntityDescriptor

public EntityDescriptor(long id,
                        int type)
Creates a new descripter given an ID and type.

Parameters:
id - the ID of the entity (or object).
type - the type of entity (or object) this is. This will be a constant from the JiveConstants class.
Method Detail

getID

public long getID()
Returns the ID of this entity (object).

Returns:
the ID of this entity.

getType

public int getType()
Returns the type of object this is. This will be an int constant from the JiveConstants class.

Returns:
the type of object this is. This will be a constant from JiveConstants.

isValid

public boolean isValid()
Returns true if this entity descriptor references a valid object. False otherwise.

Returns:
true if this entity descriptor references a valid object. False otherwise.

getCachedSize

public int getCachedSize()
Specified by:
getCachedSize in interface com.jivesoftware.community.cache.Cacheable

readExternal

public void readExternal(java.io.DataInput dataInput)
                  throws java.io.IOException
Specified by:
readExternal in interface com.tangosol.io.ExternalizableLite
Throws:
java.io.IOException

writeExternal

public void writeExternal(java.io.DataOutput dataOutput)
                   throws java.io.IOException
Specified by:
writeExternal in interface com.tangosol.io.ExternalizableLite
Throws:
java.io.IOException

equals

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

hashCode

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

Clearspace Project Page

Copyright © 1999-2007 Jive Software.