@PublicAPI public class StandardizerConfiguration extends java.lang.Object implements java.lang.Cloneable
StandardizerAction
instances. addActionToGroup(String, StandardizerAction)
and
addActionToGroups(Collection, StandardizerAction)
methods. Note,
that the StandardizerAction
must be added to the configuration using
addAction(StandardizerAction)
or addActions(List)
prior
added into a group. InvalidStandardizerAction
. In these cases the root cause
of the error can be gathered using
InvalidStandardizerAction.getErrorMessage()
method.isValid()
. If there are invalid
standardizer actions in the configuration, this function returns true. A text
representation of all errors contained by a configuration can be gathered by
the static method
createErrorMessage(StandardizerConfiguration)
. Constructor and Description |
---|
StandardizerConfiguration() |
Modifier and Type | Method and Description |
---|---|
void |
addAction(StandardizerAction action)
Adds an action to the configuration
|
void |
addActions(java.util.List<StandardizerAction> actions)
Adds actions to the configuration
|
void |
addActionToGroup(java.lang.String group,
StandardizerAction action)
Adds an action to the group
|
void |
addActionToGroups(java.util.Collection<java.lang.String> groups,
StandardizerAction action)
Adds an action to a list of groups
|
void |
clear()
Clears the configuration of action
|
StandardizerConfiguration |
clone() |
StandardizerConfiguration |
cloneConfiguration()
Clones the configuration
|
static java.lang.String |
createErrorMessage(StandardizerConfiguration configuration)
Creates an error message based on an invalid configuration
|
int |
getActionCount()
Gets the action count of the configuration
|
java.util.List<java.lang.Integer> |
getActionIndexes(java.lang.String actionString)
Gets the indexes of actions defined by the provided action string
|
java.util.List<StandardizerAction> |
getActions()
Gets all actions of the configuration
|
java.util.List<StandardizerAction> |
getActions(java.lang.String... groups)
Gets actions of a group of the configuration
|
java.util.List<StandardizerAction> |
getActions(java.lang.String group)
Gets actions of a group of the configuration
|
java.lang.String |
getGroupsOf(StandardizerAction action)
Gets the group names associated to an action separated by , character
|
int |
getLastIndexOfAction(java.lang.String token)
Gets the last index of an action defined by the provided action string
|
boolean |
isEmpty()
Gets whether the configuration contains actions
|
boolean |
isValid()
Gets whether the configuration contains only valid elements
|
void |
removeAction(StandardizerAction action)
Removes an action of the configuration
|
void |
removeActions(java.util.Collection<StandardizerAction> actions)
Removes actions of the configuration
|
java.lang.String |
toString() |
public void addAction(StandardizerAction action)
action
- the action to be added to the configurationpublic void addActions(java.util.List<StandardizerAction> actions)
actions
- the actions to be added to the configurationpublic void removeAction(StandardizerAction action)
action
- the action to be removed to the configurationpublic void removeActions(java.util.Collection<StandardizerAction> actions)
actions
- the actions to be removed to the configurationpublic java.util.List<StandardizerAction> getActions()
public java.util.List<StandardizerAction> getActions(java.lang.String group)
group
- the name of the group (case sensitive)public java.util.List<StandardizerAction> getActions(java.lang.String... groups)
groups
- the name of the group (case sensitive)public void addActionToGroup(java.lang.String group, StandardizerAction action)
group
- the name of the groupaction
- the standardizer actionpublic void addActionToGroups(java.util.Collection<java.lang.String> groups, StandardizerAction action)
groups
- the list of the group namesaction
- the standardizer actionpublic StandardizerConfiguration clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public StandardizerConfiguration cloneConfiguration()
public boolean isEmpty()
public void clear()
public java.lang.String toString()
toString
in class java.lang.Object
public int getActionCount()
public int getLastIndexOfAction(java.lang.String token)
token
- the action string token of the actionpublic java.util.List<java.lang.Integer> getActionIndexes(java.lang.String actionString)
actionString
- the action string token of the taskpublic java.lang.String getGroupsOf(StandardizerAction action)
action
- the target actionpublic boolean isValid()
public static java.lang.String createErrorMessage(StandardizerConfiguration configuration)
configuration
- the base configuration