public class ActionInstance extends Object implements Identifiable, Comparable<ActionInstance>
Constructor and Description |
---|
ActionInstance(Action action)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(Attribute attribute,
String value)
Adds attribute and its value for the instance.
|
void |
addAttributes(Map<String,String> attributes)
Adds all attributes and their values from the given map.
|
void |
clearAttributes()
Removes all attributes with their values from the instance.
|
int |
compareTo(ActionInstance a)
Comapres two instances lexicographically based on their actions.
|
boolean |
containsAttribute(Attribute attribute)
Checks whether the instance has an attribute.
|
boolean |
containsAttribute(String attributeName)
Checks whether the instance has an attribute.
|
boolean |
equals(Object obj) |
Action |
getAction()
Returns action of this instance.
|
Map<Attribute,String> |
getAttributes()
Returns all instance's attributes and their values in form of map.
|
String |
getIdentifier()
Returns action's identifier.
|
Model |
getModel()
Returns instance's model.
|
String |
getValue(Attribute attribute)
Returns value of the given attribute.
|
String |
getValue(String attributeName)
Returns value of the given attribute.
|
int |
hashCode() |
void |
removeAttribute(Attribute attribute)
Removes attribute and its value from the instance.
|
void |
setAction(Action action)
Sets action for this instance.
|
void |
setModel(Model model)
Sets model for the instance.
|
com.sun.net.httpserver.Headers |
toHeaders()
Returns an occi text representation of action instance as described in
OCCI standard in form of headers.
|
String |
toString()
Resturns string representation of the instance
|
String |
toText()
Returns a plain text representation of action instance as described in
OCCI standard.
|
public ActionInstance(Action action)
action
- action to create instance of. Cannot be null.public Action getAction()
public void setAction(Action action)
action
- action for this instance. Cannot be null.public String getIdentifier()
getIdentifier
in interface Identifiable
public Model getModel()
public void setModel(Model model)
model
- model for the instancepublic void addAttribute(Attribute attribute, String value)
attribute
- attribute to be addedvalue
- value of the attribute to be addedpublic void addAttributes(Map<String,String> attributes)
attributes
- map of attributes and their valuespublic void removeAttribute(Attribute attribute)
attribute
- attribute to be removedpublic boolean containsAttribute(Attribute attribute)
attribute
- attribute to be looked uppublic boolean containsAttribute(String attributeName)
attributeName
- name of the attribute to be looked uppublic String getValue(Attribute attribute)
attribute
- attribute which value is returnedpublic String getValue(String attributeName)
attributeName
- name of the attribute which value is returnedpublic Map<Attribute,String> getAttributes()
public void clearAttributes()
public String toText()
public com.sun.net.httpserver.Headers toHeaders()
public int hashCode()
hashCode
in class Object
Object.hashCode()
public boolean equals(Object obj)
equals
in class Object
obj
- object to compare instance withObject.equals(java.lang.Object)
public String toString()
toString
in class Object
Object.toString()
public int compareTo(ActionInstance a)
compareTo
in interface Comparable<ActionInstance>
Comparable.compareTo(java.lang.Object)
Copyright © 2016. All Rights Reserved.