com.atlassian.core.bean
Class EntityObject
java.lang.Object
com.atlassian.core.bean.EntityObject
- All Implemented Interfaces:
- java.lang.Cloneable
- public class EntityObject
- extends java.lang.Object
- implements java.lang.Cloneable
Common superclass for persistent entities: provides a long key, and creation/modification
dates. Also provides a clock for testing.
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
EntityObject
public EntityObject()
getId
public long getId()
setId
public void setId(long id)
getCreationDate
public java.util.Date getCreationDate()
setCreationDate
public void setCreationDate(java.util.Date creationDate)
getLastModificationDate
public java.util.Date getLastModificationDate()
setLastModificationDate
public void setLastModificationDate(java.util.Date lastModificationDate)
setClock
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.
getCurrentDate
public java.util.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
hashCode
public int hashCode()
equals
public boolean equals(java.lang.Object o)
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Throws:
java.lang.CloneNotSupportedException
Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.