|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.util.CaseFolding
public class CaseFolding
Utility for case folding Java Strings. This follows the advice given here. Basically the value is case folded by calling
String.toUpperCase(locale).toLowerCase(locale)
. This is a little better than calling only String.toLowerCase(locale)
. For example, in German the string "ß" upercase equilavent is "SS". If we only
called only String.toLowerCase(java.util.Locale)
we would store "ß"in the index which would make
matching "SS" impossible. This does not always case fold correctly, for example the Turkish 'I', but it is a good
compromise.
Constructor Summary | |
---|---|
CaseFolding()
|
Method Summary | |
---|---|
static String |
foldString(String s1)
Case fold the passed string using the ENGLISH locale. |
static String |
foldString(String s1,
Locale locale)
Case fold the passed string using the passed locale. |
static String |
foldUsername(String username)
Case fold the passed username using the method defined by Crowd Embedded. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CaseFolding()
Method Detail |
---|
public static String foldString(String s1)
s1
- the string to case fold. Cannot be null.
public static String foldUsername(String username)
This is ALMOST always equivalent to foldString(String)
, however CrowdEmbedded can define a different
Locale in case the external LDAP server uses another locale.
Will reutrn null output for null input.
username
- the username to case fold.
public static String foldString(String s1, Locale locale)
s1
- the string to case fold. Cannot be null.locale
- the locale to use for folding. Cannot be null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |