public class VariableContext extends Object
Constructor and Description |
---|
VariableContext() |
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(String name)
Check if a variable is part of the context.
|
String |
get(String name)
Returns the value of a variable, null values are replaced with "".
|
Set<String> |
getExtraDataset(String name)
Returns the dataset referenced by the name.
|
String |
getOriginal(String name) |
boolean |
isImmutable(String name)
Checks if the provided variable is immutable.
|
VariableContext |
put(String name,
String value)
Adds a variable with value to the context or overrides an already existing
one.
|
VariableContext |
putConditional(String name,
MappingRuleConditionalVariable variable)
This method is used to add a conditional variable to the variable context.
|
void |
putExtraDataset(String name,
Set<String> set)
Adds a set to the context, each name can only be added once.
|
void |
putOriginal(String name,
String value) |
String |
replacePathVariables(String input)
This method will consider the input as a queue path, which is a String
separated by dot ('.') characters.
|
String |
replaceVariables(String input)
This method replaces all variables in the provided string.
|
VariableContext |
setImmutables(Set<String> variableNames)
Can be used to provide a set which contains the name of the variables which
should be immutable.
|
VariableContext |
setImmutables(String... variableNames)
Can be used to provide an array of strings which contains the names of the
variables which should be immutable.
|
public boolean isImmutable(String name)
name
- Name of the variable to checkpublic VariableContext setImmutables(Set<String> variableNames)
variableNames
- Set containing the names of the immutable variablesIllegalStateException
- if the immutable set is already provided.public VariableContext setImmutables(String... variableNames)
variableNames
- Set containing the names of the immutable variablesIllegalStateException
- if the immutable set is already provided.public VariableContext put(String name, String value)
name
- Name of the variable to be added to the contextvalue
- Value of the variableIllegalStateException
- if the variable is immutable and already setpublic VariableContext putConditional(String name, MappingRuleConditionalVariable variable)
name
- Name of the variablevariable
- The conditional variable evaluatorpublic String get(String name)
name
- Name of the variablepublic void putExtraDataset(String name, Set<String> set)
name
- Name which can be used to reference the collectionset
- The dataset to be storedpublic Set<String> getExtraDataset(String name)
name
- Name of the set to be returned.public boolean containsKey(String name)
name
- Name of the variable to be checkedpublic String replaceVariables(String input)
input
- The string with variablespublic String replacePathVariables(String input)
input
- The string with variablesCopyright © 2008–2024 Apache Software Foundation. All rights reserved.