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

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

public class DefaultAction
extends 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

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

Constructor Detail

DefaultAction

public DefaultAction(String name,
                     boolean required)
Creates an instance of DefaultAction with specified name and requirement. Name cannot be null or an empty or blank string.

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

DefaultAction

public DefaultAction(String name)
Creates an instance of DefaultAction with specified name. The DefaultAction is required by default. Name cannot be null or an empty or blank string.

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

getName

public String getName()
Specified by:
getName in interface ContextEventAction
Returns:
the name of the event action.

setRequired

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

isRequried

public boolean isRequried()
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 Object
Returns:
a hash code value for this DefaultAction.

equals

public boolean equals(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 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.