public class

EntityObject

extends Object
implements Cloneable
java.lang.Object
   ↳ com.atlassian.core.bean.EntityObject

Class Overview

Common superclass for persistent entities: provides a long key, and creation/modification dates. Also provides a clock for testing.

Summary

Public Constructors
EntityObject()
Public Methods
Object clone()
boolean equals(Object o)
Date getCreationDate()
Date getCurrentDate()
Consult the clock to get the current date.
long getId()
Date getLastModificationDate()
int hashCode()
void setClock(Clock clock)
The clock is used to fool the entity into thinking that the current time is different to what it actually is.
void setCreationDate(Date creationDate)
void setId(long id)
void setLastModificationDate(Date lastModificationDate)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public EntityObject ()

Public Methods

public Object clone ()

public boolean equals (Object o)

public Date getCreationDate ()

public Date getCurrentDate ()

Consult the clock to get the current date.

Returns
  • the current date as per the clock set in #setClock, or new Date() if no clock is set

public long getId ()

public Date getLastModificationDate ()

public int hashCode ()

public void setClock (Clock clock)

The clock is used to fool the entity into thinking that the current time is different to what it actually is. Used in tests so we get consistent results with time-based activities.

public void setCreationDate (Date creationDate)

public void setId (long id)

public void setLastModificationDate (Date lastModificationDate)