uk.ac.ebi.intenz.domain
Class DomainObject

java.lang.Object
  extended by uk.ac.ebi.intenz.domain.DomainObject
Direct Known Subclasses:
EnzymeCommissionNumber, HistoryEvent, Timeout

public class DomainObject
extends Object

This class is the base class of most of the domain classes.

It only stores the ID.

Version:
$Revision: 1.2 $ $Date: 2008/01/28 12:33:13 $
Author:
Michael Darsow

Field Summary
protected  Long id
          IDs can be long, therefore this data type.
 
Constructor Summary
protected DomainObject()
          The ID is initially set to 0.
protected DomainObject(Long id)
          Initialises the ID.
 
Method Summary
 boolean equals(Object o)
           
 Long getId()
           
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected Long id
IDs can be long, therefore this data type. Furthermore the ID is frequently used as an object key (e.g. within a HashMap) and thus should be of type Long instead of long.

Constructor Detail

DomainObject

protected DomainObject()
The ID is initially set to 0.


DomainObject

protected DomainObject(Long id)
Initialises the ID.

Parameters:
id - the new ID.
Throws:
NullPointerException - if id is null.
IllegalArgumentException - if id is < 0.
Method Detail

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getId

public Long getId()


Copyright © 2013 EMBL-EBI. All Rights Reserved.