public final class ChangeEventUtils
extends java.lang.Object
ChangeEvent
objects. The helper methods are mostly condition checkers (verify if a specific condition is true/false based on the
data of a ChangeEvent object), and functions (applying a function to the data contained in a ChangeEvent).| Modifier and Type | Method and Description |
|---|---|
static void |
addAttribute(ChangeEvent changeEvent,
java.lang.String attribute,
java.util.List<java.lang.String> values)
Adds the specified attribute and its associated values to the specified ChangeEvent object.
|
static void |
addAttribute(ChangeEvent changeEvent,
java.lang.String attribute,
java.lang.String value)
Adds the specified attribute and its associated value to the specified ChangeEvent object.
|
static java.util.List<java.lang.String> |
append(java.util.List<java.lang.String> valueList,
java.util.List<java.lang.String> valueList2)
Retrieves a list containing the value of each element from the first
list, appended to the value of each element in the second list.
|
static java.util.List<java.lang.String> |
appendValue(java.util.List<java.lang.String> valueList,
java.lang.String value)
Retrieves a list containing the value of each element appended with the
given value.
|
static boolean |
applyComplexAttributeCondition(ChangeEvent ce,
java.lang.String attributeName,
java.lang.String subAttributeName,
int comparisonValue,
Operator operator,
ComparisonType comparisonType)
Indicates if the complex attribute and its specified sub-attribute found in the ChangeEvent object
matches the condition described by the given parameters.
|
static boolean |
applyComplexAttributeCondition(ChangeEvent ce,
java.lang.String attributeName,
java.lang.String subAttributeName,
java.lang.String comparisonValue,
Operator operator,
ComparisonType comparisonType)
Indicates if the complex attribute and its specified sub-attribute found in the ChangeEvent object
matches the condition described by the given parameters.
|
static boolean |
applyCondition(ChangeEvent ce,
java.lang.String attributeName,
int comparisonValue,
Operator operator,
ComparisonType comparisonType)
Indicates if the attribute found in the ChangeEvent object matches the
condition described by the given parameters.
|
static boolean |
applyCondition(ChangeEvent ce,
java.lang.String attributeName,
java.lang.String comparisonValue,
Operator operator,
ComparisonType comparisonType)
Indicates if the attribute found in the ChangeEvent object matches the
condition described by the given parameters.
|
static boolean |
applyCondition(java.util.List<java.lang.String> values,
int comparisonValue,
Operator operator,
ComparisonType comparisonType)
Indicates if the condition described by the given parameters is
true or false. |
static boolean |
applyCondition(java.util.List<java.lang.String> values,
java.lang.String comparisonValue,
Operator operator,
ComparisonType comparisonType)
Indicates if the condition described by the given parameters is
true or false. |
static boolean |
applyCondition(java.util.Map<java.lang.String,java.util.Map<PatchOpType,IdentityPatchOperation>> changesMap,
java.lang.String attributeName,
PatchOpType patchOpType,
boolean assertEquality)
Indicates whether the specified map contains the specified patch operation type for the specified attribute name.
|
static java.util.List<java.lang.String> |
buildExpression(java.lang.Object... obj)
Returns a list containing one element that is composed from the
concatenation of all the given strings (Note: this method is designed for
multivalue support).
|
static java.util.List<java.lang.String> |
buildExpression(java.lang.String... str)
Returns a list containing one element that is composed from the
concatenation of all the given strings.
|
static java.util.List<java.lang.String> |
concat(java.lang.String... elems)
Returns a list containing a single String composed of the concatenation of all the specified elements.
|
static java.util.List<java.lang.String> |
decodeBase64(java.util.List<java.lang.String> valueList)
Retrieves a list containing the value of each element decoded in Base 64.
|
static java.util.List<java.lang.String> |
decodeBase64WithoutPrefix(java.util.List<java.lang.String> valueList)
Retrieves a list containing the value of each element decoded in Base 64.
|
static java.util.List<java.lang.String> |
encodeBase64(java.util.List<java.lang.String> valueList)
Retrieves a list containing the value of each element encoded in Base 64.
|
static java.util.List<java.lang.String> |
encodeBase64WithoutPrefix(java.util.List<java.lang.String> valueList)
Retrieves a list containing the value of each element encoded in Base 64.
|
static java.util.List<java.lang.String> |
escapeRdnValue(java.util.List<java.lang.String> valueList)
Retrieves a list containing the value of each element escaped according
to the RDN value syntax.
|
static java.util.List<java.lang.String> |
escapeRdnValue(java.lang.String value)
Retrieves a list containing the value of each element escaped according
to the RDN value syntax.
|
static java.util.List<java.lang.String> |
filterMatchingRegex(java.util.List<java.lang.String> valueList,
java.lang.String regex)
Returns a list of values keeping only the values that match the given regex.
|
static java.util.List<java.lang.String> |
filterNotMatchingRegex(java.util.List<java.lang.String> valueList,
java.lang.String regex)
Returns a list of values keeping only the values that do NOT match the given regex.
|
static java.util.List<java.lang.String> |
filterOutEmpty(java.util.List<java.lang.String> valueList)
Returns a list of values with any empty/blank/null value removed.
|
static java.lang.String |
getIdentifier(ChangeEvent ce)
Returns the event ID of the specified ChangeEvent.
|
static java.util.List<java.lang.String> |
getParentDN(java.util.List<java.lang.String> valueList)
Get the parent of each DN of the given list.
|
static java.util.List<java.lang.String> |
getRDN(java.util.List<java.lang.String> valueList,
int index)
Get the specified RDN in the given list of DN.
|
static java.util.List<java.lang.String> |
getRDNRange(java.util.List<java.lang.String> valueList,
int startIndex,
int endIndex)
Retrieves the range of elements from the startIndex to the endIndex (inclusive) found in the RDN array.
|
static java.util.List<java.lang.String> |
getRdnValue(java.util.List<java.lang.String> valueList,
int index)
Get the specified RDN value from the given list of DN.
|
static java.util.List<java.lang.String> |
getRdnValueRange(java.util.List<java.lang.String> valueList,
int startIndex,
int endIndex)
Retrieves the range of elements from the startIndex to the endIndex (inclusive) found in the RDN values array.
|
static java.util.List<java.lang.String> |
getValuesFromMap(java.lang.String attributeName,
PatchOpType patchOpType,
java.util.Map<java.lang.String,java.util.Map<PatchOpType,IdentityPatchOperation>> changesMap)
Returns the list of values found inside the specified map, based on the given attribute name and patch
operation type.
|
static boolean |
hasExactlyOneEmptyValue(ChangeEvent ce,
java.lang.String attributeName)
Returns true if the attribute contains exactly one single empty value.
|
static boolean |
hasExactlyOneEmptyValue(java.util.List<java.lang.String> values)
Returns true if the given list of values contains exactly one single
empty value.
|
static boolean |
hasNonEmptyValue(ChangeEvent ce,
java.lang.String attributeName)
Returns true if the attribute contains at least one non-empty value.
|
static java.util.List<java.lang.String> |
head(java.util.List<java.lang.String> valueList,
int length)
Retrieves a list containing the substrings of all the elements in the
given list.
|
static java.util.List<java.lang.String> |
lookUpAttribute(java.lang.String datasourceName,
java.util.List<java.lang.String> baseDnList,
java.util.List<java.lang.String> ldapFilterList,
int scope,
java.lang.String attribute,
int sizeLimit)
Perform a LDAP search onto the named database with the parameters
entered.
|
static java.util.List<java.lang.String> |
lookUpAttribute(java.lang.String datasourceName,
java.util.List<java.lang.String> baseDnList,
java.util.List<java.lang.String> ldapFilterList,
java.lang.String scope,
java.lang.String attribute,
int sizeLimit)
Perform a LDAP search onto the named database with the parameters
entered.
|
static java.util.List<java.lang.String> |
lookUpAttribute(java.lang.String datasourceName,
java.util.List<java.lang.String> baseDnValues,
java.lang.String ldapFilter,
int scope,
java.lang.String attribute,
int sizeLimit)
Perform a LDAP search for a single return attribute and returns the values for that attribute.
|
static java.util.List<java.lang.String> |
lookUpAttribute(java.lang.String datasourceName,
java.util.List<java.lang.String> baseDnValues,
java.lang.String ldapFilter,
java.lang.String scope,
java.lang.String attribute,
int sizeLimit)
Perform a LDAP search for a single return attribute and returns the values for that attribute.
|
static java.util.List<java.lang.String> |
lookUpAttribute(java.lang.String datasourceName,
java.lang.String baseDn,
java.util.List<java.lang.String> ldapFilterValues,
int scope,
java.lang.String attribute,
int sizeLimit)
Perform a LDAP search for a single return attribute and returns the values for that attribute.
|
static java.util.List<java.lang.String> |
lookUpAttribute(java.lang.String datasourceName,
java.lang.String baseDn,
java.util.List<java.lang.String> ldapFilterValues,
java.lang.String scope,
java.lang.String attribute,
int sizeLimit)
Perform a LDAP search for a single return attribute and returns the values for that attribute.
|
static java.util.List<java.lang.String> |
lookUpAttribute(java.lang.String datasourceName,
java.lang.String baseDn,
java.lang.String ldapFilter,
int scope,
java.lang.String attribute,
int sizeLimit)
Perform a LDAP search for a single return attribute and returns the values for that attribute.
|
static java.util.List<java.lang.String> |
lookUpAttribute(java.lang.String datasourceName,
java.lang.String baseDn,
java.lang.String ldapFilter,
java.lang.String scope,
java.lang.String attribute,
int sizeLimit)
Perform a LDAP search for a single return attribute and returns the values for that attribute.
|
static java.util.List<java.lang.String> |
lowercase(java.util.List<java.lang.String> valueList)
Retrieves a list containing the value of each element in lower case.
|
static java.util.List<java.lang.String> |
prependValue(java.util.List<java.lang.String> valueList,
java.lang.String prefixValue)
Retrieves a list containing the value of each element prepended with the
given prefix value.
|
static java.util.List<java.lang.String> |
remapDN(java.util.List<java.lang.String> dnValuesToRemap,
java.lang.String datasourceName,
java.util.List<java.lang.String> baseDnList,
int scope,
java.lang.String attributeToLookup)
For each of the DN values to remap, extracts the RDN value and performs a
search on the specified data source using the specified scope and base
DN, with the following search filter: (attributeToLookup=RDN value).
|
static java.util.List<java.lang.String> |
remapDN(java.util.List<java.lang.String> dnValuesToRemap,
java.lang.String datasourceName,
java.util.List<java.lang.String> baseDnList,
java.lang.String scope,
java.lang.String attributeToLookup)
For each of the DN values to remap, extracts the RDN value and performs a
search on the specified data source using the specified scope and base
DN, with the following search filter: (attributeToLookup=RDN value).
|
static java.util.List<java.lang.String> |
remapDN(java.util.List<java.lang.String> dnValuesToRemap,
java.lang.String datasourceName,
java.lang.String baseDn,
int scope,
java.lang.String attributeToLookup)
For each of the DN values to remap, extracts the RDN value and performs a
search on the specified data source using the specified scope and base
DN, with the following search filter: (attributeToLookup=RDN value).
|
static java.util.List<java.lang.String> |
remapDN(java.util.List<java.lang.String> dnValuesToRemap,
java.lang.String datasourceName,
java.lang.String baseDn,
java.lang.String scope,
java.lang.String attributeToLookup)
For each of the DN values to remap, extracts the RDN value and performs a
search on the specified data source using the specified scope and base
DN, with the following search filter: (attributeToLookup=RDN value).
|
static java.util.List<java.lang.String> |
replaceAll(java.util.List<java.lang.String> src,
java.lang.String value,
java.lang.String replac)
Replace all occurrences in the list of the given value by another.
|
static java.util.List<java.lang.String> |
replaceAllRegex(java.util.List<java.lang.String> src,
java.lang.String value,
java.lang.String replac)
Replace all occurrences in the list of the given value by another.
|
static java.util.List<java.lang.String> |
replaceDnSuffix(java.util.List<java.lang.String> valueList,
java.lang.String suffixToReplace,
java.lang.String replacementSuffix)
Replaces a suffix in a DN with another suffix.
|
static java.util.List<java.lang.String> |
replaceFirst(java.util.List<java.lang.String> src,
java.lang.String value,
java.lang.String replac)
Replace the first occurrence of the given value for each element of the
list by another.
|
static java.util.List<java.lang.String> |
replaceFirstRegex(java.util.List<java.lang.String> src,
java.lang.String value,
java.lang.String replac)
Replace the first occurrence of the given value for each element of the
list by another.
|
static java.util.List<java.lang.String> |
replaceFromDictionary(java.util.List<java.lang.String> valueList,
java.lang.String dictionaryFileName,
java.lang.String defaultValue)
Replace the values with their exact matches from the given file.
|
static java.util.List<java.lang.String> |
substring(java.util.List<java.lang.String> valueList,
int index)
Retrieves a list containing the substrings of all the elements in the
given list.
|
static java.util.List<java.lang.String> |
substringAfter(java.util.List<java.lang.String> valueList,
java.lang.String separator)
Retrieves a list containing the substrings of all the elements in the
given list.
|
static java.util.List<java.lang.String> |
substringAfterLast(java.util.List<java.lang.String> valueList,
java.lang.String separator)
Retrieves a list containing the substrings of all the elements in the
given list.
|
static java.util.List<java.lang.String> |
substringBefore(java.util.List<java.lang.String> valueList,
java.lang.String separator)
Retrieves a list containing the substrings of all the elements in the
given list.
|
static java.util.List<java.lang.String> |
substringBeforeLast(java.util.List<java.lang.String> valueList,
java.lang.String separator)
Retrieves a list containing the substrings of all the elements in the
given list.
|
static java.util.List<java.lang.String> |
substringLength(java.util.List<java.lang.String> valueList,
int index,
int length)
Retrieves a list containing the substrings of all the elements in the
given list.
|
static java.util.List<java.lang.String> |
substringStartEnd(java.util.List<java.lang.String> valueList,
int indexStart,
int indexEnd)
Retrieves a list containing the substrings of all the elements in the
given list.
|
static java.util.List<java.lang.String> |
tail(java.util.List<java.lang.String> valueList,
int length)
Retrieves a list containing the substrings of all the elements in the
given list.
|
static java.util.List<java.lang.String> |
translateValueWithRegex(java.util.List<java.lang.String> valueList,
java.lang.String regexRules)
Applies the specified regular expression rules to the input list of values.
|
static java.util.List<java.lang.String> |
trim(java.util.List<java.lang.String> valueList)
Retrieves a list containing the value of each element with leading and
trailing whitespace removed.
|
static java.util.List<java.lang.String> |
union(java.util.List<java.lang.String>... elems)
Returns a list containing the union of all the provided elements.
|
static java.util.List<java.lang.String> |
uppercase(java.util.List<java.lang.String> valueList)
Retrieves a list containing the value of each element in upper case.
|
public static java.lang.String getIdentifier(ChangeEvent ce)
ce - A ChangeEvent.public static java.util.List<java.lang.String> remapDN(java.util.List<java.lang.String> dnValuesToRemap,
java.lang.String datasourceName,
java.lang.String baseDn,
java.lang.String scope,
java.lang.String attributeToLookup)
dnValuesToRemap - The values in DN format.datasourceName - The data source on which the search will be performed.baseDn - The base DN for the search.scope - The scope of the search (base, one, or sub).attributeToLookup - The attribute for the search filter.public static java.util.List<java.lang.String> remapDN(java.util.List<java.lang.String> dnValuesToRemap,
java.lang.String datasourceName,
java.lang.String baseDn,
int scope,
java.lang.String attributeToLookup)
dnValuesToRemap - The values in DN format.datasourceName - The data source on which the search will be performed.baseDn - The base DN for the search.scope - The scope of the search (0, 1, or 2).attributeToLookup - The attribute for the search filter.public static java.util.List<java.lang.String> remapDN(java.util.List<java.lang.String> dnValuesToRemap,
java.lang.String datasourceName,
java.util.List<java.lang.String> baseDnList,
java.lang.String scope,
java.lang.String attributeToLookup)
dnValuesToRemap - The values in DN format.datasourceName - The data source on which the search will be performed.baseDnList - The base DN for the search. Only the first element of the
list is used.scope - The scope of the search (base, one, or sub).attributeToLookup - The attribute for the search filter.public static java.util.List<java.lang.String> remapDN(java.util.List<java.lang.String> dnValuesToRemap,
java.lang.String datasourceName,
java.util.List<java.lang.String> baseDnList,
int scope,
java.lang.String attributeToLookup)
dnValuesToRemap - The values in DN format.datasourceName - The data source on which the search will be performed.baseDnList - The base DN for the search. Only the first element of the
list is used.scope - The scope of the search (0, 1, or 2).attributeToLookup - The attribute for the search filter.public static java.util.List<java.lang.String> lookUpAttribute(java.lang.String datasourceName,
java.lang.String baseDn,
java.lang.String ldapFilter,
int scope,
java.lang.String attribute,
int sizeLimit)
datasourceName - The name of the database the search is performed on. (LDAP or
AD)baseDn - The base DN of the search.ldapFilter - The filter applied to the search. Default is (objectclass=*).scope - The scope of the search. Default is BASE.attribute - The attribute of the search.sizeLimit - Number of search displayed max.public static java.util.List<java.lang.String> lookUpAttribute(java.lang.String datasourceName,
java.lang.String baseDn,
java.lang.String ldapFilter,
java.lang.String scope,
java.lang.String attribute,
int sizeLimit)
datasourceName - The name of the database the search is performed on. (LDAP or
AD)baseDn - The base DN of the search.ldapFilter - The filter applied to the search. Default is (objectclass=*).scope - The scope of the search, accepted values are: base, one, sub.attribute - The attribute of the search.sizeLimit - Number of search displayed max.public static java.util.List<java.lang.String> lookUpAttribute(java.lang.String datasourceName,
java.lang.String baseDn,
java.util.List<java.lang.String> ldapFilterValues,
int scope,
java.lang.String attribute,
int sizeLimit)
datasourceName - The name of the database the search is performed on. (LDAP or
AD)baseDn - The base DN of the search.ldapFilterValues - The filter values applied to the search. A new search is
issued for each filter value.scope - The scope of the search. Default is BASE.attribute - The attribute of the search.sizeLimit - Number of search displayed max.public static java.util.List<java.lang.String> lookUpAttribute(java.lang.String datasourceName,
java.lang.String baseDn,
java.util.List<java.lang.String> ldapFilterValues,
java.lang.String scope,
java.lang.String attribute,
int sizeLimit)
datasourceName - The name of the database the search is performed on. (LDAP or
AD)baseDn - The base DN of the search.ldapFilterValues - The filter values applied to the search. A new search is
issued for each filter value.scope - The scope of the search, accepted values are: base, one, sub.attribute - The attribute of the search.sizeLimit - Number of search displayed max.public static java.util.List<java.lang.String> lookUpAttribute(java.lang.String datasourceName,
java.util.List<java.lang.String> baseDnList,
java.util.List<java.lang.String> ldapFilterList,
int scope,
java.lang.String attribute,
int sizeLimit)
datasourceName - The name of the database the search is performed on. (LDAP or
AD)baseDnList - The base DN values for the search. A new search is issued for
each base DN.ldapFilterList - The filter values for the search. A new search is issued for
each filter value.scope - The scope of the search. Default is BASE.attribute - The attribute of the search.sizeLimit - Number of search displayed max.public static java.util.List<java.lang.String> lookUpAttribute(java.lang.String datasourceName,
java.util.List<java.lang.String> baseDnList,
java.util.List<java.lang.String> ldapFilterList,
java.lang.String scope,
java.lang.String attribute,
int sizeLimit)
datasourceName - The name of the database the search is performed on. (LDAP or
AD)baseDnList - The base DN values for the search. A new search is issued for
each base DN.ldapFilterList - The filter values for the search. A new search is issued for
each filter value.scope - The scope of the search, accepted values are: base, one, sub.attribute - The attribute of the search.sizeLimit - Number of search displayed max.public static java.util.List<java.lang.String> lookUpAttribute(java.lang.String datasourceName,
java.util.List<java.lang.String> baseDnValues,
java.lang.String ldapFilter,
int scope,
java.lang.String attribute,
int sizeLimit)
datasourceName - The name of the database the search is performed on. (LDAP or
AD)baseDnValues - The base DNs for the search. A new LDAP search is issued for
each base DN value.ldapFilter - The filter applied to each search. Default is (objectclass=*).scope - The scope of the search. Default is BASE.attribute - The attribute of the search.sizeLimit - Number of search displayed max.public static java.util.List<java.lang.String> lookUpAttribute(java.lang.String datasourceName,
java.util.List<java.lang.String> baseDnValues,
java.lang.String ldapFilter,
java.lang.String scope,
java.lang.String attribute,
int sizeLimit)
datasourceName - The name of the database the search is performed on. (LDAP or
AD)baseDnValues - The base DNs for the search. A new LDAP search is issued for
each base DN value.ldapFilter - The filter applied to each search. Default is (objectclass=*).scope - The scope of the search, accepted values are: base, one, sub.attribute - The attribute of the search.sizeLimit - Number of search displayed max.public static java.util.List<java.lang.String> getRDN(java.util.List<java.lang.String> valueList,
int index)
valueList - List of DN.index - index of the RDN to return.public static java.util.List<java.lang.String> getRDNRange(java.util.List<java.lang.String> valueList,
int startIndex,
int endIndex)
valueList - A list of DN values.startIndex - The start index for the range.endIndex - The end index for the range (note: range is inclusive and will include the element at this
index).public static java.util.List<java.lang.String> getRdnValueRange(java.util.List<java.lang.String> valueList,
int startIndex,
int endIndex)
valueList - A list of DN values.startIndex - The start index for the range.endIndex - The end index for the range (note: range is inclusive and will include the element at this
index).public static java.util.List<java.lang.String> replaceDnSuffix(java.util.List<java.lang.String> valueList,
java.lang.String suffixToReplace,
java.lang.String replacementSuffix)
valueList - A list of distinguished names.suffixToReplace - The suffix to search for.replacementSuffix - The replacement suffix.public static java.util.List<java.lang.String> getRdnValue(java.util.List<java.lang.String> valueList,
int index)
valueList - List of DN.index - index of the RDN value to return.public static java.util.List<java.lang.String> getParentDN(java.util.List<java.lang.String> valueList)
valueList - List of DNpublic static java.util.List<java.lang.String> replaceAll(java.util.List<java.lang.String> src,
java.lang.String value,
java.lang.String replac)
src - List of values.value - Value to replace. Does not accept Regex.replac - Replacement value.public static java.util.List<java.lang.String> replaceAllRegex(java.util.List<java.lang.String> src,
java.lang.String value,
java.lang.String replac)
src - List of values.value - Value to replace. Regex Sensible.replac - Replacement value.public static java.util.List<java.lang.String> replaceFirst(java.util.List<java.lang.String> src,
java.lang.String value,
java.lang.String replac)
src - List of values.value - Value to replace. Does not accept Regex.replac - Replacement value.public static java.util.List<java.lang.String> replaceFirstRegex(java.util.List<java.lang.String> src,
java.lang.String value,
java.lang.String replac)
src - List of values.value - Value to replace. Regex sensible.replac - Replacement value.public static java.util.List<java.lang.String> trim(java.util.List<java.lang.String> valueList)
valueList - A list of values.public static java.util.List<java.lang.String> replaceFromDictionary(java.util.List<java.lang.String> valueList,
java.lang.String dictionaryFileName,
java.lang.String defaultValue)
valueList - A list of values.dictionaryFileName - Name of the file containing the key-value mappings.defaultValue - A list of values.public static java.util.List<java.lang.String> escapeRdnValue(java.util.List<java.lang.String> valueList)
valueList - A list of values.public static java.util.List<java.lang.String> escapeRdnValue(java.lang.String value)
value - A value to escape.public static java.util.List<java.lang.String> decodeBase64(java.util.List<java.lang.String> valueList)
valueList - A list of values.public static java.util.List<java.lang.String> decodeBase64WithoutPrefix(java.util.List<java.lang.String> valueList)
valueList - A list of values.public static java.util.List<java.lang.String> encodeBase64(java.util.List<java.lang.String> valueList)
valueList - A list of values.public static java.util.List<java.lang.String> encodeBase64WithoutPrefix(java.util.List<java.lang.String> valueList)
valueList - A list of values.public static java.util.List<java.lang.String> substring(java.util.List<java.lang.String> valueList,
int index)
valueList - A list of values.index - The index to use to perform the substring operation on each
element.public static java.util.List<java.lang.String> substringLength(java.util.List<java.lang.String> valueList,
int index,
int length)
valueList - A list of values.index - The index to use to perform the substring operation on each
element.length - The length of each substring.public static java.util.List<java.lang.String> substringStartEnd(java.util.List<java.lang.String> valueList,
int indexStart,
int indexEnd)
valueList - A list of values.indexStart - The index from which the substring operation will start on
each element.indexEnd - The index from which the substring operation will end on each
element.public static java.util.List<java.lang.String> head(java.util.List<java.lang.String> valueList,
int length)
valueList - A list of values.length - The length of the substring from the start of the String.public static java.util.List<java.lang.String> tail(java.util.List<java.lang.String> valueList,
int length)
valueList - A list of values.length - The length of the substring from the end of the String.public static java.util.List<java.lang.String> substringAfter(java.util.List<java.lang.String> valueList,
java.lang.String separator)
valueList - A list of values.separator - String to determine the limit of the substring.public static java.util.List<java.lang.String> substringAfterLast(java.util.List<java.lang.String> valueList,
java.lang.String separator)
valueList - A list of values.separator - String to determine the limit of the substring.public static java.util.List<java.lang.String> substringBefore(java.util.List<java.lang.String> valueList,
java.lang.String separator)
valueList - A list of values.separator - String to determine the limit of the substring.public static java.util.List<java.lang.String> substringBeforeLast(java.util.List<java.lang.String> valueList,
java.lang.String separator)
valueList - A list of values.separator - String to determine the limit of the substring.public static java.util.List<java.lang.String> prependValue(java.util.List<java.lang.String> valueList,
java.lang.String prefixValue)
valueList - A list of values.prefixValue - The value that will be prepended with each element.public static java.util.List<java.lang.String> buildExpression(java.lang.Object... obj)
obj - A set of strings and Lists of Strings that compose the
expression.public static java.util.List<java.lang.String> concat(java.lang.String... elems)
elems - The elements to concatenate.@SafeVarargs public static java.util.List<java.lang.String> union(java.util.List<java.lang.String>... elems)
elems - The elements to perform the union on.public static java.util.List<java.lang.String> buildExpression(java.lang.String... str)
str - A set of strings that compose the expression.public static java.util.List<java.lang.String> append(java.util.List<java.lang.String> valueList,
java.util.List<java.lang.String> valueList2)
valueList - A list of values.valueList2 - A list of values.public static java.util.List<java.lang.String> appendValue(java.util.List<java.lang.String> valueList,
java.lang.String value)
valueList - A list of values.value - The value that will be appended to each element.public static java.util.List<java.lang.String> lowercase(java.util.List<java.lang.String> valueList)
valueList - A list of values.public static java.util.List<java.lang.String> translateValueWithRegex(java.util.List<java.lang.String> valueList,
java.lang.String regexRules)
If one of the regex pattern (left side of the -->) in the rules match, the value will be modified based on the "new value" (right side of the -->).
Example:
Regex rules: San Francisco --> CA ## Chicago --> IL ## New York --> NY ## (.+) -->
Unknown city: $1
If these rules were applied on a list of: [ "San Francisco", "Chicago" , "New York", "Arrakis" ], the result would be
a new list with the following elements: [ "CA", "IL", "NY", "Unknown city: Arrakis" ]
valueList - A list of values.regexRules - A String containing the regular expression rules.public static java.util.List<java.lang.String> uppercase(java.util.List<java.lang.String> valueList)
valueList - A list of values.public static java.util.List<java.lang.String> filterOutEmpty(java.util.List<java.lang.String> valueList)
valueList - A list of values.public static java.util.List<java.lang.String> filterNotMatchingRegex(java.util.List<java.lang.String> valueList,
java.lang.String regex)
valueList - A list of values.regex - A regular expression.public static java.util.List<java.lang.String> filterMatchingRegex(java.util.List<java.lang.String> valueList,
java.lang.String regex)
valueList - A list of values.regex - A regular expression.public static boolean applyCondition(java.util.Map<java.lang.String,java.util.Map<PatchOpType,IdentityPatchOperation>> changesMap, java.lang.String attributeName, PatchOpType patchOpType, boolean assertEquality)
changesMap - A map, organized by attribute name, containing the patch operations (add value(s)/
replace value(s)/delete value(s)) associated with each attribute.attributeName - The name of the attribute to check for.patchOpType - The type of patch operation to check for.assertEquality - If true, asserts that the map contains the specified patch operation type for the
specified attribute name. If false, asserts that the map does NOT contain the
specified patch operation type for the specified attribute name.true if the specified map contains the specified patch operation type for the specified attribute
name. Returns false otherwise.public static boolean applyCondition(java.util.List<java.lang.String> values,
java.lang.String comparisonValue,
Operator operator,
ComparisonType comparisonType)
true or false.values - The list of values on which the condition will be checked.comparisonValue - A value used for checking a condition, if the operator
requires a comparison value.operator - The operator for the condition.comparisonType - The comparison type for the condition.true if the condition matches, or false
otherwise.public static boolean applyCondition(java.util.List<java.lang.String> values,
int comparisonValue,
Operator operator,
ComparisonType comparisonType)
true or false.values - The list of values on which the condition will be checked.comparisonValue - A value used for checking a condition, if the operator
requires a comparison value.operator - The operator for the condition.comparisonType - The comparison type for the condition.true if the condition matches, or false
otherwise.public static boolean applyComplexAttributeCondition(ChangeEvent ce, java.lang.String attributeName, java.lang.String subAttributeName, int comparisonValue, Operator operator, ComparisonType comparisonType)
ce - A ChangeEvent object containing a list of attributes and their values.attributeName - The name of a complex attribute.subAttributeName - The name of a sub-attribute of a complex attribute.comparisonValue - A value used for checking the condition, if the operator requires a comparison value.operator - The operator for the condition.comparisonType - The comparison type for the condition.true if the condition for the attribute matches, or false otherwise.public static boolean applyComplexAttributeCondition(ChangeEvent ce, java.lang.String attributeName, java.lang.String subAttributeName, java.lang.String comparisonValue, Operator operator, ComparisonType comparisonType)
ce - A ChangeEvent object containing a list of attributes and their values.attributeName - The name of a complex attribute.subAttributeName - The name of a sub-attribute of a complex attribute.comparisonValue - A value used for checking the condition, if the operator requires a comparison value.operator - The operator for the condition.comparisonType - The comparison type for the condition.true if the condition for the attribute matches, or false otherwise.public static boolean applyCondition(ChangeEvent ce, java.lang.String attributeName, int comparisonValue, Operator operator, ComparisonType comparisonType)
ce - A ChangeEvent object containing a list of attributes and
their values.attributeName - The name of the attribute on which the condition will be
checked.comparisonValue - A value used for checking a condition, if the operator
requires a comparison value.operator - The operator for the condition.comparisonType - The comparison type for the condition.true if the condition for the attribute matches, or
false otherwise.public static boolean applyCondition(ChangeEvent ce, java.lang.String attributeName, java.lang.String comparisonValue, Operator operator, ComparisonType comparisonType)
ce - A ChangeEvent object containing a list of attributes and
their values.attributeName - The name of the attribute on which the condition will be
checked.comparisonValue - A value used for checking a condition, if the operator
requires a comparison value.operator - The operator for the condition.comparisonType - The comparison type for the condition.true if the condition for the attribute matches, or
false otherwise.public static boolean hasNonEmptyValue(ChangeEvent ce, java.lang.String attributeName)
ce - A ChangeEvent object containing a list of attributes and
their values.attributeName - The name of the attribute on which the condition will be
checked.true if the attribute contains at least one non-empty
value, or false otherwise.public static boolean hasExactlyOneEmptyValue(ChangeEvent ce, java.lang.String attributeName)
ce - A ChangeEvent object containing a list of attributes and
their values.attributeName - The name of the attribute on which the condition will be
checked.true if the attribute contains exactly one single empty
value, or false otherwise.public static boolean hasExactlyOneEmptyValue(java.util.List<java.lang.String> values)
values - The list of values on which the condition will be checked.true if the attribute contains exactly one single empty
value, or false otherwise.public static java.util.List<java.lang.String> getValuesFromMap(java.lang.String attributeName,
PatchOpType patchOpType,
java.util.Map<java.lang.String,java.util.Map<PatchOpType,IdentityPatchOperation>> changesMap)
attributeName - The name of an attribute.patchOpType - A patch operation type.changesMap - A map containing all the patch operations, organized by attribute name.public static void addAttribute(ChangeEvent changeEvent, java.lang.String attribute, java.util.List<java.lang.String> values)
changeEvent - A change event object.attribute - An attribute name.values - A set of values to set for the attribute.public static void addAttribute(ChangeEvent changeEvent, java.lang.String attribute, java.lang.String value)
changeEvent - A change event object.attribute - An attribute name.value - A value to set for the attribute.