at.ac.tuwien.infosys.sm4all.copal.api.event
Class DefaultAction

java.lang.Object
  extended by at.ac.tuwien.infosys.sm4all.copal.api.event.DefaultAction
All Implemented Interfaces:
ContextEventAction

public class DefaultAction
extends java.lang.Object
implements ContextEventAction

Class which defines a default action that can be executed on an event. This class has one-to-many association with the ContextEventType.

Author:
sanjin

Field Summary
static boolean REQUIREMENT_DEFAULT
          Default requirement of DefaultAction.
 
Constructor Summary
DefaultAction(java.lang.String name)
          Create instance of DefaultAction with specified name and requirement set to REQUIREMENT_DEFAULT.
DefaultAction(java.lang.String name, boolean required)
          Create instance of DefaultAction with specified name and requirement.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this DefaultAction to the specified Object.
 java.lang.String getName()
          Returns the name of this ContextEventAction.
 int hashCode()
          Returns hash code for this DefaultAction.
 boolean isRequired()
           
 void setRequired(boolean required)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REQUIREMENT_DEFAULT

public static final boolean REQUIREMENT_DEFAULT
Default requirement of DefaultAction.

See Also:
Constant Field Values
Constructor Detail

DefaultAction

public DefaultAction(java.lang.String name,
                     boolean required)
Create instance of DefaultAction with specified name and requirement.

Parameters:
name - the name of the DefaultAction.
required - if the DefaultAction should be required.
Throws:
java.lang.NullPointerException - if specified name is null.
java.lang.IllegalArgumentException - if specified name is an empty or blank string.

DefaultAction

public DefaultAction(java.lang.String name)
Create instance of DefaultAction with specified name and requirement set to REQUIREMENT_DEFAULT.

Parameters:
name - the name of the DefaultAction.
Throws:
java.lang.NullPointerException - if specified name is null.
java.lang.IllegalArgumentException - if specified name is an empty or blank string.
Method Detail

getName

public java.lang.String getName()
Description copied from interface: ContextEventAction
Returns the name of this ContextEventAction.

Specified by:
getName in interface ContextEventAction
Returns:
the name of this ContextEventAction.

setRequired

public void setRequired(boolean required)
Parameters:
required - if the DefaultAction should be required.

isRequired

public boolean isRequired()
Returns:
if the DefaultAction is required.

hashCode

public int hashCode()
Returns hash code for this DefaultAction. The hash code for a DefaultAction object is hash code of its name.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this DefaultAction.

equals

public boolean equals(java.lang.Object obj)
Compares this DefaultAction to the specified Object. The result is true if and only if the argument is not null and is DefaultAction object that has same name and requirement as this DefaultAction.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the Object to compare this DefaultAction against.
Returns:
true if DefaultActions are equal; false otherwise.


Copyright © 2010 Distributed Systems Group, Vienna University of Technology. All Rights Reserved.