Package com.mongodb.client.model
Enum Class CollationStrength
- All Implemented Interfaces:
Serializable
,Comparable<CollationStrength>
,java.lang.constant.Constable
Collation support allows the specific configuration of how differences between characters are handled.
- Since:
- 3.4
- Since server release
- 3.4
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionWhen all other levels are equal, the identical level is used as a tiebreaker.Strongest level, denote difference between base charactersWhen punctuation is ignored at level 1-3, an additional level can be used to distinguish words with and without punctuation.Accents in characters are considered secondary differencesUpper and lower case differences in characters are distinguished at the tertiary level. -
Method Summary
Modifier and TypeMethodDescriptionstatic CollationStrength
fromInt
(int intRepresentation) Gets the order from the given integer representation.int
The integer representation of the collation strength.static CollationStrength
Returns the enum constant of this class with the specified name.static CollationStrength[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PRIMARY
Strongest level, denote difference between base characters -
SECONDARY
Accents in characters are considered secondary differences -
TERTIARY
Upper and lower case differences in characters are distinguished at the tertiary level. The server default. -
QUATERNARY
When punctuation is ignored at level 1-3, an additional level can be used to distinguish words with and without punctuation. -
IDENTICAL
When all other levels are equal, the identical level is used as a tiebreaker. The Unicode code point values of the NFD form of each string are compared at this level, just in case there is no difference at levels 1-4
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getIntRepresentation
public int getIntRepresentation()The integer representation of the collation strength.- Returns:
- the integer representation
-
fromInt
Gets the order from the given integer representation.- Parameters:
intRepresentation
- the integer representation- Returns:
- the order
-