public class

CaseFolding

extends Object
java.lang.Object
   ↳ com.atlassian.jira.util.CaseFolding

Class Overview

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 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.

Summary

Public Constructors
CaseFolding()
Public Methods
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)
This method is deprecated. Use getKey() or toLowerCase(String). Since v6.0
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public CaseFolding ()

Public Methods

public static String foldString (String s1)

Case fold the passed string using the ENGLISH locale.

Parameters
s1 the string to case fold. Cannot be null.
Returns
  • the case folded string.

public static String foldString (String s1, Locale locale)

Case fold the passed string using the passed locale. You probaly should not use this method because setting a locale may result in non-standard case folding. For example, using the Turkish locale will case fold "I" into "ı" (dotless lowercase letter i).

Parameters
s1 the string to case fold. Cannot be null.
locale the locale to use for folding. Cannot be null.
Returns
  • the case folded string.

public static String foldUsername (String username)

This method is deprecated.
Use getKey() or toLowerCase(String). Since v6.0

Case fold the passed username using the method defined by Crowd Embedded. Will return null output for null input.

Parameters
username the username to case fold.
Returns
  • the case folded username.