Class IdentifierUtils
java.lang.Object
com.atlassian.crowd.embedded.impl.IdentifierUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic intcompareToInLowerCase(String identifier1, String identifier2) Converts the two given identifier strings to lowercase and compare them.static BiPredicate<String,String> Returns function that checks presence of an entry in the originalMap, ignoring string casing.containsIdentifierPredicate(Collection<String> identifiers) static booleanequalsInLowerCase(String identifier1, String identifier2) Converts the two given identifier strings to lowercase and check for equality.static booleanstatic voidstatic StringtoLowerCase(String identifier) Converts the given identifier string to lowercase.toLowerCase(Collection<? extends String> identifiers) Converts the given set identifier string to lowercase.
-
Field Details
-
TO_LOWER_CASE
Function oftoLowerCase(String)method.
-
-
Method Details
-
prepareIdentifierCompareLocale
public static void prepareIdentifierCompareLocale() -
toLowerCase
Converts the given identifier string to lowercase. The rule of conversion is subject to the language defined in crowd.identifier.language system property.- Parameters:
identifier- the identifier string, null allowed.- Returns:
- lowercase identifier.
-
toLowerCase
Converts the given set identifier string to lowercase. The rule of conversion is subject to the language defined in crowd.identifier.language system property.- Parameters:
identifiers- the identifier strings, nulls allowed.- Returns:
- set of lowercase identifier.
-
containsIdentifierPredicate
- Parameters:
identifiers- the identifier strings, nulls allowed.- Returns:
Predicatereturning whether given identifier is inidentifiers, ignoring case
-
compareToInLowerCase
Converts the two given identifier strings to lowercase and compare them. The rule of conversion is subject to the language defined in crowd.identifier.language system property.- Parameters:
identifier1- identifier. Must not be nullidentifier2- identifier. Must not be null- Returns:
- comparison result similar to as
Comparator.compare(Object, Object)}
-
equalsInLowerCase
Converts the two given identifier strings to lowercase and check for equality. The rule of conversion is subject to the language defined in crowd.identifier.language system property.- Parameters:
identifier1- identifier. Can be nullidentifier2- identifier. Can be null- Returns:
- true if equal, otherwise false.
-
hasLeadingOrTrailingWhitespace
- Parameters:
s- a non-nullidentifier- Returns:
trueif this identifier starts or ends with white space
-
containsIdentifierBiPredicate
public static BiPredicate<String,String> containsIdentifierBiPredicate(Map<String, List<String>> map) Returns function that checks presence of an entry in the originalMap, ignoring string casing.- Parameters:
map- original case sensitive map- Returns:
- function that checks presence of an entry in the original
Map, ignoring string casing
-