ccc.domain
Class Entity

java.lang.Object
  extended by ccc.domain.Entity
All Implemented Interfaces:
Jsonable, java.io.Serializable
Direct Known Subclasses:
ActionEntity, CommentEntity, Data, LogEntry, Principal, ResourceEntity, RevisionEntity, Setting, WorkingCopy

public abstract class Entity
extends java.lang.Object
implements java.io.Serializable, Jsonable

Abstract base class extended by entity classes that require persistence.

Author:
Civic Computing Ltd.
See Also:
Serialized Form

Constructor Summary
protected Entity()
          Constructor: for persistence only.
protected Entity(java.util.UUID id, long version)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object obj)
          
 java.util.UUID getId()
          Accessor for the id field.
 long getVersion()
          Accessor for the version field.
 int hashCode()
          
 void setId(java.util.UUID id)
          Set this entity's id.
 void toJson(Json json)
          Deprecated. 
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Entity

protected Entity()
Constructor: for persistence only.


Entity

protected Entity(java.util.UUID id,
                 long version)
Constructor.

Parameters:
id - The entity's ID.
version - The entity's version.
Method Detail

getId

public java.util.UUID getId()
Accessor for the id field.

Returns:
This entity's id as a UUID.

setId

public void setId(java.util.UUID id)
Set this entity's id.

Parameters:
id - The new id.

getVersion

public long getVersion()
Accessor for the version field.

Returns:
This entity's version as a long.

hashCode

public final int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public final boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

toJson

@Deprecated
public void toJson(Json json)
Deprecated. 

Convert to JSON.

Specified by:
toJson in interface Jsonable
Parameters:
json - The JSON object to write to.


Copyright © 2010. All Rights Reserved.