Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community
Class EntityDescriptor

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

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

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

Field Summary
protected  long objectID
           
protected  int objectType
           
 
Constructor Summary
EntityDescriptor()
          No args constructor for serialization
EntityDescriptor(int objectType, long objectID)
          Creates a new descripter given an ID and type.
EntityDescriptor(JiveObject bean)
          Creates an EntityDescriptor instance from an existing JiveObject.
 
Method Summary
 boolean equals(Object o)
           
 int getCachedSize()
           
 long getID()
          Returns the ID of this entity (object).
 int getObjectType()
          Returns the type of object this is.
 int getType()
          Deprecated. getObjectType() should used instead, since it is defined in JiveObject.
 int hashCode()
           
 boolean isValid()
          Returns true if this entity descriptor references a valid object.
 void readExternal(DataInput dataInput)
           
 String toString()
           
 void writeExternal(DataOutput dataOutput)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

objectID

protected long objectID

objectType

protected int objectType
Constructor Detail

EntityDescriptor

public EntityDescriptor()
No args constructor for serialization


EntityDescriptor

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

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

EntityDescriptor

public EntityDescriptor(JiveObject bean)
Creates an EntityDescriptor instance from an existing JiveObject.

Parameters:
bean - The JiveObject to create an EntityDescriptor for.
Since:
1.8
Method Detail

getID

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

Specified by:
getID in interface JiveObject
Returns:
the ID of this entity.

getType

@Deprecated
public int getType()
Deprecated. getObjectType() should used instead, since it is defined in JiveObject.

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.

getObjectType

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

Specified by:
getObjectType in interface JiveObject
Returns:
object type of the object.
Since:
1.8

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(DataInput dataInput)
                  throws IOException
Specified by:
readExternal in interface com.tangosol.io.ExternalizableLite
Throws:
IOException

writeExternal

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

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

Clearspace Project Page

Copyright © 1999-2007 Jive Software.