Class IdentifierUtils

java.lang.Object
com.atlassian.crowd.embedded.impl.IdentifierUtils

public final class IdentifierUtils extends Object
  • Field Details

  • Method Details

    • prepareIdentifierCompareLocale

      public static void prepareIdentifierCompareLocale()
    • toLowerCase

      public static String toLowerCase(String identifier)
      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

      public static Set<String> toLowerCase(Collection<? extends String> identifiers)
      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

      public static Predicate<String> containsIdentifierPredicate(Collection<String> identifiers)
      Parameters:
      identifiers - the identifier strings, nulls allowed.
      Returns:
      Predicate returning whether given identifier is in identifiers, ignoring case
    • compareToInLowerCase

      public static int compareToInLowerCase(String identifier1, String identifier2)
      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 null
      identifier2 - identifier. Must not be null
      Returns:
      comparison result similar to as Comparator.compare(Object, Object)}
    • equalsInLowerCase

      public static boolean equalsInLowerCase(String identifier1, String identifier2)
      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 null
      identifier2 - identifier. Can be null
      Returns:
      true if equal, otherwise false.
    • hasLeadingOrTrailingWhitespace

      public static boolean hasLeadingOrTrailingWhitespace(String s)
      Parameters:
      s - a non-null identifier
      Returns:
      true if 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 original Map, ignoring string casing.
      Parameters:
      map - original case sensitive map
      Returns:
      function that checks presence of an entry in the original Map, ignoring string casing