com.atlassian.crowd.embedded.impl
Class IdentifierUtils

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

public final class IdentifierUtils
extends Object


Field Summary
static com.google.common.base.Function<String,String> TO_LOWER_CASE
          Function of toLowerCase(String) method.
 
Method Summary
static int compareToInLowerCase(String identifier1, String identifier2)
          Converts the two given identifier strings to lowercase and compare them.
static boolean equalsInLowerCase(String identifier1, String identifier2)
          Converts the two given identifier strings to lowercase and check for equality.
static boolean hasLeadingOrTrailingWhitespace(String s)
           
static void prepareIdentifierCompareLocale()
           
static String toLowerCase(String identifier)
          Converts the given identifier string to lowercase.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TO_LOWER_CASE

public static final com.google.common.base.Function<String,String> TO_LOWER_CASE
Function of toLowerCase(String) method.

Method Detail

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.

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


Copyright © 2013 Atlassian. All Rights Reserved.