Package com.couchbase.lite
Class Collation
- java.lang.Object
-
- com.couchbase.lite.Collation
-
- Direct Known Subclasses:
Collation.ASCII,Collation.Unicode
public class Collation extends Object
Collation defines how strings are compared and is used when creating a COLLATE expression. The COLLATE expression can be used in the WHERE clause when comparing two strings or in the ORDER BY clause when specifying how the order of the query results. CouchbaseLite provides two types of the Collation, ASCII and Unicode. Without specifying the COLLATE expression Couchbase Lite will use the ASCII with case sensitive collation by default.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCollation.ASCIIASCII collation compares two strings by using binary comparison.static classCollation.UnicodeUnicode Collation that will compare two strings by using Unicode collation algorithm.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Collation.ASCIIascii()Creates an ASCII collation that will compare two strings by using binary comparison.protected CollationsetIgnoreAccents(boolean ignoreAccents)protected CollationsetIgnoreCase(boolean ignoreCase)protected CollationsetLocale(String locale)StringtoString()static Collation.Unicodeunicode()Creates a Unicode collation that will compare two strings by using Unicode Collation Algorithm.
-
-
-
Constructor Detail
-
Collation
protected Collation(boolean isUnicode, @Nullable String locale)
-
-
Method Detail
-
ascii
@NonNull public static Collation.ASCII ascii()
Creates an ASCII collation that will compare two strings by using binary comparison.- Returns:
- The ASCII collation.
-
unicode
@NonNull public static Collation.Unicode unicode()
Creates a Unicode collation that will compare two strings by using Unicode Collation Algorithm. If the locale is not specified, the collation is Unicode-aware but not localized; for example, accented Roman letters sort right after the base letter- Returns:
- The Unicode collation.
-
setIgnoreAccents
@NonNull protected Collation setIgnoreAccents(boolean ignoreAccents)
-
setIgnoreCase
@NonNull protected Collation setIgnoreCase(boolean ignoreCase)
-
-