openfuture.bugbase.domain
Class DomainObject

java.lang.Object
  |
  +--openfuture.bugbase.domain.DomainObject
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
BugReport, Login

public class DomainObject
extends java.lang.Object
implements java.io.Serializable

Base class for domain objects. Handles the state of domain objects.

Created: Fri Jun 09 03:46:29 2000

Version:
$Revision: 1.4 $
Author:
Wolfgang Reissenberger
See Also:
Serialized Form

Field Summary
static int STATE_CLEAN
           
static int STATE_DELETED
           
static int STATE_DIRTY
           
static int STATE_NEW
           
 
Constructor Summary
DomainObject()
           
 
Method Summary
protected  int getState()
          Get the value of state.
 boolean isDeleted()
          Returns true, if the domain object is deleted.
 boolean isDirty()
          Returns true, if the domain object is dirty.
 boolean isNew()
          Returns true, if the domain object is new.
 void setClean()
          Sets the state to 'clean'.
 void setDirty()
          Sets the state to 'dirty'.
 void setModified()
          State set to STATE_DIRTY except for STATE_NEW.
protected  void setState(int v)
          Set the value of state.
 java.util.LinkedList validate()
          Validate the domain object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_NEW

public static final int STATE_NEW

STATE_CLEAN

public static final int STATE_CLEAN

STATE_DIRTY

public static final int STATE_DIRTY

STATE_DELETED

public static final int STATE_DELETED
Constructor Detail

DomainObject

public DomainObject()
Method Detail

setModified

public void setModified()
State set to STATE_DIRTY except for STATE_NEW.

setDirty

public void setDirty()
Sets the state to 'dirty'.

setClean

public void setClean()
Sets the state to 'clean'.

isDirty

public boolean isDirty()
Returns true, if the domain object is dirty.
Returns:
true, if the domain object is dirty.

isNew

public boolean isNew()
Returns true, if the domain object is new.
Returns:
true, if the domain object is new.

isDeleted

public boolean isDeleted()
Returns true, if the domain object is deleted.
Returns:
true, if the domain object is deleted.

getState

protected int getState()
Get the value of state.
Returns:
Value of state.

setState

protected void setState(int v)
Set the value of state.
Parameters:
v - Value to assign to state.

validate

public java.util.LinkedList validate()
Validate the domain object. A list of message keys is returned describing why the object is not valid.
Returns:
list of validation failures.


Copyright © 2000 -- 2003 openfuture.de. All Rights Reserved.