public class ServiceManagerChange
extends java.lang.Object
Constructor and Description |
---|
ServiceManagerChange()
Create a new empty
ServiceManagerChange object |
ServiceManagerChange(org.dom4j.Node root)
Create a new
ServiceManagerChange object and initialize it with the values in root |
Modifier and Type | Method and Description |
---|---|
void |
addDynamicList(java.lang.String field,
java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> values)
Add a dynamic list for the specified field.
|
void |
addFields(java.util.Map<java.lang.String,java.lang.Object> fields)
Add all the specified fields to this incident if they do not already exist
|
void |
addList(java.lang.String field,
java.util.Collection<java.lang.String> list)
Add a list of possible values for the field
|
void |
addList(java.lang.String field,
java.util.Map<java.lang.String,java.lang.String> list)
Add a list of possible values and the associated display value for the field
|
void |
addUpdate(java.lang.String field,
java.lang.String value)
Add a update value for the specified field
|
java.util.Map<java.lang.String,java.lang.Object> |
constructUpdateInstance()
Construct a list of fields that have been updated and their new values
|
java.util.Collection<java.lang.String> |
getList(java.lang.String field)
Return the list of possible values for the field
|
java.util.List<java.lang.String> |
getListValue(java.lang.String field)
Retrieve the current list of values for a list field
|
java.util.List<java.lang.String> |
getListValue(java.lang.String field,
boolean escape)
Retrieve the current list of values for a list field
|
java.util.Map<java.lang.String,java.lang.Object> |
getOriginalMap()
Returns the a map of the original values for this incident
|
java.util.Collection<java.lang.String> |
getPossibleValues(java.lang.String field)
If the field specified has a list of values specified return it
|
java.lang.String |
getTextValue(java.lang.String field)
Retrieve the current value for a text field
|
java.lang.String |
getTextValue(java.lang.String field,
boolean escape)
Retrieve the current value for a text field
|
java.util.Map<java.lang.String,java.lang.String> |
getUpdateMap()
Returns the a map of the updated values for this incident
|
boolean |
isListField(java.lang.String field)
Check if the specified field contains a list of values
|
boolean |
isTextField(java.lang.String field)
Check if the specified field contains a single of value
|
void |
updateDynamicList(java.lang.String field,
java.lang.String dependsOn)
Update the list of possible values for the field depending on the specified value
|
public ServiceManagerChange()
ServiceManagerChange
objectpublic ServiceManagerChange(org.dom4j.Node root)
ServiceManagerChange
object and initialize it with the values in rootroot
- A instance element containing the fields of a Service Manager incidentpublic void addFields(java.util.Map<java.lang.String,java.lang.Object> fields)
fields
- The fields to add to this incident if they do not already existpublic java.util.Map<java.lang.String,java.lang.Object> constructUpdateInstance()
ServiceManagerScriptObject
objects methods containing all the
updates for this instancepublic boolean isListField(java.lang.String field)
field
- The field namepublic java.util.List<java.lang.String> getListValue(java.lang.String field)
field
- The field namepublic java.util.List<java.lang.String> getListValue(java.lang.String field, boolean escape)
field
- The field nameescape
- If the value returned should be escaped for xml/htmlpublic boolean isTextField(java.lang.String field)
field
- The field namepublic java.lang.String getTextValue(java.lang.String field)
field
- The field namepublic java.lang.String getTextValue(java.lang.String field, boolean escape)
field
- The field nameescape
- If the value returned should be escaped for xml/htmlpublic java.util.Collection<java.lang.String> getPossibleValues(java.lang.String field)
field
- The field namepublic void addUpdate(java.lang.String field, java.lang.String value)
field
- The field namevalue
- The updated value for the fieldpublic void addList(java.lang.String field, java.util.Map<java.lang.String,java.lang.String> list)
field
- The field namelist
- A Map of real values to display valuespublic void addList(java.lang.String field, java.util.Collection<java.lang.String> list)
field
- The field namelist
- A Collection of possible valuespublic java.util.Collection<java.lang.String> getList(java.lang.String field)
field
- The field namepublic void addDynamicList(java.lang.String field, java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> values)
field
- The field namevalues
- A Map of dependent values to possible valuespublic void updateDynamicList(java.lang.String field, java.lang.String dependsOn)
field
- The field namedependsOn
- The value of the field this field depends onpublic java.util.Map<java.lang.String,java.lang.Object> getOriginalMap()
public java.util.Map<java.lang.String,java.lang.String> getUpdateMap()