Class EngineAccess.DialogHistoryUtilities
- Object
-
- DialogHistoryUtilities
-
- Enclosing class:
- EngineAccess
public final class EngineAccess.DialogHistoryUtilities extends Object
This class provides utility methods for modification of the dialog history data.- Since:
- 6.2.0
-
-
Constructor Summary
Constructors Constructor Description DialogHistoryUtilities()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
redact(int _iHistoryIndex, int _iBeginIndex, int _iEndIndex, char _cMask)
Replaces a specified range of the user input text on a specified history item with a given mask character.void
removeLogVariables(List<String> _lNames)
Removes selected log variables from all log variables maps.void
removeMetadata(List<String> _lNames)
Removes selected metadata entries from all metadata mapsvoid
removeRequestParameters(List<String> _lNames)
Removes selected entries from all request parameter maps.void
removeResponseVariables(List<String> _lNames)
Removes selected variables from all response variables maps.void
removeVariables(List<String> _lNames)
Removes selected variables from the changes data of session, flow, annotation variables.void
replaceLogVariables(BiFunction<String,String,String> _function)
Applies the given function to all log variables.void
replaceLogVariables(List<String> _lNames, String _sReplacement)
Replaces the values of selected log variables.void
replaceMetadata(BiFunction<String,String,String> _function)
Applies the given function to all metadata maps.void
replaceMetadata(List<String> _lNames, String _sReplacement)
Replaces the values of selected metadata map entries.void
replaceRequestParameters(BiFunction<String,String[],String[]> _function)
Applies the given function to all request parameters.void
replaceRequestParameters(List<String> _lNames, String[] _sReplacement)
Replaces the values of selected request parameters.void
replaceResponseText(Function<String,String> _function)
Applies the given function to all answer/output texts.void
replaceResponseText(List<String> _lStrings, String _sReplacement)
Replaces all matches of the specified strings in all answer/output texts.void
replaceResponseURL(Function<String,String> _function)
Applies the given function to all answer/output URLs.void
replaceResponseURL(List<String> _lStrings, String _sReplacement)
Replaces all matches of the specified strings in all answer/output URLs.void
replaceResponseVariables(BiFunction<String,String,String> _function)
Applies the given function to all response variables.void
replaceResponseVariables(List<String> _lNames, String _sReplacement)
Replaces the values of selected response variables.void
replaceUserInputText(Function<String,String> _function)
Applies the given function to all user input texts.void
replaceUserInputText(List<String> _lStrings, String _sReplacement)
Replaces all matches of the specified strings in all user input texts.void
replaceVariables(BiFunction<String,Object,Object> _function)
Applies the given function to all variables in the changes data of session, flow, annotation variables.void
replaceVariables(List<String> _lNames, Object _replacement)
Replaces the values of selected variables in the changes data of session, flow, annotation variables.
-
-
-
Method Detail
-
replaceMetadata
public void replaceMetadata(List<String> _lNames, String _sReplacement)
Replaces the values of selected metadata map entries.- Parameters:
_lNames
- names of the metadata entries to be modified_sReplacement
- the replacement value- Throws:
IllegalArgumentException
- if a passed parameter isnull
- Since:
- 6.2.0
-
replaceMetadata
public void replaceMetadata(BiFunction<String,String,String> _function)
Applies the given function to all metadata maps. Function result cannot be null.- Parameters:
_function
- a function accepting two arguments (metadata name and value) producing the new value that must not be {code null}- Throws:
IllegalArgumentException
- if the passed function parameter isnull
, or if the function returnednull
- Since:
- 6.2.0
-
replaceVariables
public void replaceVariables(List<String> _lNames, Object _replacement)
Replaces the values of selected variables in the changes data of session, flow, annotation variables.- Parameters:
_lNames
- names of the variables to be modified_replacement
- the replacement value (may benull
)- Throws:
IllegalArgumentException
- if the passed names parameter isnull
- Since:
- 6.2.0
-
replaceVariables
public void replaceVariables(BiFunction<String,Object,Object> _function)
Applies the given function to all variables in the changes data of session, flow, annotation variables. Function result can be null.- Parameters:
_function
- a function accepting two arguments (variable name and value) producing the new value (it may benull
)- Throws:
IllegalArgumentException
- if the passed function parameter isnull
- Since:
- 6.2.0
-
replaceLogVariables
public void replaceLogVariables(List<String> _lNames, String _sReplacement)
Replaces the values of selected log variables.- Parameters:
_lNames
- names of the log variables to be modified_sReplacement
- the replacement value- Throws:
IllegalArgumentException
- if a passed parameter isnull
- Since:
- 6.2.0
-
replaceLogVariables
public void replaceLogVariables(BiFunction<String,String,String> _function)
Applies the given function to all log variables. Function result cannot be null.- Parameters:
_function
- a function accepting two arguments (log variable name and value) producing the new value that must not be {code null}- Throws:
IllegalArgumentException
- if the passed function parameter isnull
, or if the function returnednull
- Since:
- 6.2.0
-
replaceResponseVariables
public void replaceResponseVariables(List<String> _lNames, String _sReplacement)
Replaces the values of selected response variables.- Parameters:
_lNames
- names of the response variables to be modified_sReplacement
- the replacement value- Throws:
IllegalArgumentException
- if a passed parameter isnull
- Since:
- 6.2.0
-
replaceResponseVariables
public void replaceResponseVariables(BiFunction<String,String,String> _function)
Applies the given function to all response variables. Function result cannot be null.- Parameters:
_function
- a function accepting two arguments (response variable key and value) producing the new value that must not be {code null}- Throws:
IllegalArgumentException
- if the passed function parameter isnull
, or if the function returnednull
- Since:
- 6.2.0
-
replaceRequestParameters
public void replaceRequestParameters(List<String> _lNames, String[] _sReplacement)
Replaces the values of selected request parameters.- Parameters:
_lNames
- names of the request parameters to be modified_sReplacement
- the replacement value- Throws:
IllegalArgumentException
- if a passed parameter isnull
- Since:
- 6.2.0
-
replaceRequestParameters
public void replaceRequestParameters(BiFunction<String,String[],String[]> _function)
Applies the given function to all request parameters. Function result cannot be null.- Parameters:
_function
- a function accepting two arguments (request parameter name and value) producing the new value that must not be {code null}- Throws:
IllegalArgumentException
- if the passed function parameter isnull
, or if the function returnednull
- Since:
- 6.2.0
-
replaceResponseURL
public void replaceResponseURL(List<String> _lStrings, String _sReplacement)
Replaces all matches of the specified strings in all answer/output URLs.- Parameters:
_lStrings
- the strings to match against_sReplacement
- the replacement value- Throws:
IllegalArgumentException
- if a passed parameter isnull
- Since:
- 6.2.0
-
replaceResponseURL
public void replaceResponseURL(Function<String,String> _function)
Applies the given function to all answer/output URLs. Function result cannot be null.- Parameters:
_function
- a function accepting one argument (the answer/output URL) producing the new URL that must not be {code null}- Throws:
IllegalArgumentException
- if the passed function parameter isnull
, or if the function returnednull
- Since:
- 6.2.0
-
replaceResponseText
public void replaceResponseText(List<String> _lStrings, String _sReplacement)
Replaces all matches of the specified strings in all answer/output texts.- Parameters:
_lStrings
- the strings to match against_sReplacement
- the replacement value- Throws:
IllegalArgumentException
- if a passed parameter isnull
- Since:
- 6.2.0
-
replaceResponseText
public void replaceResponseText(Function<String,String> _function)
Applies the given function to all answer/output texts. Function result cannot be null.- Parameters:
_function
- a function accepting one argument (the answer/output text) producing the new text that must not be {code null}- Throws:
IllegalArgumentException
- if the passed function parameter isnull
, or if the function returnednull
- Since:
- 6.2.0
-
replaceUserInputText
public void replaceUserInputText(List<String> _lStrings, String _sReplacement)
Replaces all matches of the specified strings in all user input texts. If the user input text is changed, then input processing and used words data is reset. Note that all "userinput" request parameters are not affected by this replacement.- Parameters:
_lStrings
- the strings to match against_sReplacement
- the replacement value- Throws:
IllegalArgumentException
- if a passed parameter isnull
- Since:
- 6.2.1
-
replaceUserInputText
public void replaceUserInputText(Function<String,String> _function)
Applies the given function to all user input texts. If the user input text is changed, then input processing and used words data is reset. Note that all "userinput" request parameters are not affected by this replacement.- Parameters:
_function
- a function accepting one argument (the user input text) producing the new text that must not benull
- Throws:
IllegalArgumentException
- if the passed function parameter isnull
or if the function returnednull
- Since:
- 6.2.1
-
removeMetadata
public void removeMetadata(List<String> _lNames)
Removes selected metadata entries from all metadata maps- Parameters:
_lNames
- names of the metadata entries to be removed- Throws:
IllegalArgumentException
- if the passed names parameter isnull
- Since:
- 6.2.0
-
removeLogVariables
public void removeLogVariables(List<String> _lNames)
Removes selected log variables from all log variables maps.- Parameters:
_lNames
- names of the log variables to be removed- Throws:
IllegalArgumentException
- if the passed names parameter isnull
- Since:
- 6.2.0
-
removeVariables
public void removeVariables(List<String> _lNames)
Removes selected variables from the changes data of session, flow, annotation variables.- Parameters:
_lNames
- names of the variables to be removed- Throws:
IllegalArgumentException
- if the passed names parameter isnull
- Since:
- 6.2.0
-
removeResponseVariables
public void removeResponseVariables(List<String> _lNames)
Removes selected variables from all response variables maps.- Parameters:
_lNames
- names of the response variables to be removed- Throws:
IllegalArgumentException
- if the passed names parameter isnull
- Since:
- 6.2.0
-
removeRequestParameters
public void removeRequestParameters(List<String> _lNames)
Removes selected entries from all request parameter maps.- Parameters:
_lNames
- the names of the request parameters to be removed- Throws:
IllegalArgumentException
- if the passed names parameter isnull
- Since:
- 6.2.0
-
redact
public void redact(int _iHistoryIndex, int _iBeginIndex, int _iEndIndex, char _cMask)
Replaces a specified range of the user input text on a specified history item with a given mask character. Affected used-words are also redacted in all processing path elements. Note that "userinput" request parameter is not affected by redaction.- Parameters:
_iHistoryIndex
- the index of the history item in the dialog history on where the redaction is applied_iBeginIndex
- the character index in the user input text where the redaction starts, inclusive_iEndIndex
- the character index in the user input text where the redaction ends, exclusive_cMask
- the mask character to be used for redaction- Throws:
IllegalArgumentException
- if the begin index or the history index is less than 0, or if the end index is less than the begin index, or if the history index is greater than or equal to the dialog history length, or if the end index is greater than the user input length- Since:
- 6.2.0
-
-