org.perfectjpattern.core.behavioral.observer.data
Class StatusData

java.lang.Object
  extended by org.perfectjpattern.core.behavioral.observer.data.StatusData
All Implemented Interfaces:
IEventData
Direct Known Subclasses:
ProgressData

public class StatusData
extends Object
implements IEventData

Immutable Observer event data intended to be used in notifying status information.

Version:
$Revision: 1.0 $ $Date: Jun 17, 2007 2:20:44 PM $
Author:
Giovanni Azua
 

Field Summary
static StatusData COMPLETED
          Reusable StatusData instance corresponding to a Completed state.
static StatusData FAILED
          Reusable StatusData instance corresponding to a Failed event.
static StatusData STARTED
          Reusable StatusData instance corresponding to a Started event.
 
Constructor Summary
StatusData(StatusData aStatusData)
          Copy constructor.
StatusData(Status aStatus, String aMessage)
          Constructor that creates a StatusData instance from a Status and message.
 
Method Summary
 boolean equals(Object anObject)
          
 String getMessage()
          Returns message associated with this StatusData.
 Status getStatus()
          Returns the Status value associated with this StatusData from the set of predefined possible values Status.
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STARTED

public static final StatusData STARTED
Reusable StatusData instance corresponding to a Started event.


FAILED

public static final StatusData FAILED
Reusable StatusData instance corresponding to a Failed event.


COMPLETED

public static final StatusData COMPLETED
Reusable StatusData instance corresponding to a Completed state.

Constructor Detail

StatusData

public StatusData(Status aStatus,
                  String aMessage)
Constructor that creates a StatusData instance from a Status and message.

Parameters:
aStatus - Status of the task
aMessage - Description of the current theStatus
Throws:
IllegalArgumentException - "'aStatus' must not be null"
IllegalArgumentException - "'aMessage' must not be null"

StatusData

public StatusData(StatusData aStatusData)
Copy constructor.

Parameters:
aStatusData - Existing StatusData
Throws:
IllegalArgumentException - "'aStatus' must not be null"
IllegalArgumentException - "'aMessage' must not be null"
Method Detail

getMessage

public String getMessage()
Returns message associated with this StatusData. Offers a user-friendly description of the status.

Returns:
Message associated with this StatusData. Offers a user-friendly description of the status.

getStatus

public Status getStatus()
Returns the Status value associated with this StatusData from the set of predefined possible values Status.

Returns:
Status value associated with this StatusData from the set of predefined possible values Status.

equals

public boolean equals(Object anObject)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2007-2009. All Rights Reserved.