org.opennms.bb.dp.events
Class EventAttributeStateOnOff

java.lang.Object
  |
  +--org.opennms.bb.dp.events.EventAttributeStateOnOff
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EventForward, EventTroubleTicket

public class EventAttributeStateOnOff
extends Object
implements Serializable

This class is designed to be subclassed by both the EventTroubleTicket and EventForward object, both of which have state on/off information. The class is not designed to be instantiated by itself and thus its constructors are all protected for use by the derived classes.

Version:
CVS $Revision: 1.4 $
Author:
Brian Weaver, OpenNMS
See Also:
Serialized Form

Field Summary
protected  int m_state
          The state of the instance.
static int STATE_OFF
          The value that defines the state of the instance as off.
static int STATE_ON
          The value that defines the state of the instance as on.
 
Constructor Summary
protected EventAttributeStateOnOff()
          Constructs a new instance with the default values.
protected EventAttributeStateOnOff(EventAttributeStateOnOff second)
          Constructs a new instance by copying the appropriate values from the passed instance.
protected EventAttributeStateOnOff(int state)
          Constructs a new instance with the specified state.
 
Method Summary
 int getState()
          Returns the current state of the object.
 void setState(int state)
          Sets the state for the object.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

STATE_ON

public static final int STATE_ON
The value that defines the state of the instance as on.

STATE_OFF

public static final int STATE_OFF
The value that defines the state of the instance as off.

m_state

protected int m_state
The state of the instance.
Constructor Detail

EventAttributeStateOnOff

protected EventAttributeStateOnOff()
Constructs a new instance with the default values. The default state is set to "on".

EventAttributeStateOnOff

protected EventAttributeStateOnOff(int state)
Constructs a new instance with the specified state.
Parameters:
state - The state for the new instance.

EventAttributeStateOnOff

protected EventAttributeStateOnOff(EventAttributeStateOnOff second)
Constructs a new instance by copying the appropriate values from the passed instance.
Parameters:
second - The instance to copy values from.
Method Detail

getState

public int getState()
Returns the current state of the object.
Returns:
The current state.
See Also:
STATE_ON, STATE_OFF

setState

public void setState(int state)
Sets the state for the object.
Parameters:
state - The new state.
See Also:
STATE_ON, STATE_OFF