Enum Class CollationStrength

java.lang.Object
java.lang.Enum<CollationStrength>
com.mongodb.client.model.CollationStrength
All Implemented Interfaces:
Serializable, Comparable<CollationStrength>, java.lang.constant.Constable

public enum CollationStrength extends Enum<CollationStrength>
Collation support allows the specific configuration of how differences between characters are handled.
Since:
3.4
Since server release
3.4
  • Enum Constant Details

    • PRIMARY

      public static final CollationStrength PRIMARY
      Strongest level, denote difference between base characters
    • SECONDARY

      public static final CollationStrength SECONDARY
      Accents in characters are considered secondary differences
    • TERTIARY

      public static final CollationStrength TERTIARY
      Upper and lower case differences in characters are distinguished at the tertiary level. The server default.
    • QUATERNARY

      public static final CollationStrength QUATERNARY
      When punctuation is ignored at level 1-3, an additional level can be used to distinguish words with and without punctuation.
    • IDENTICAL

      public static final CollationStrength 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

      public static CollationStrength[] 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

      public static CollationStrength valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getIntRepresentation

      public int getIntRepresentation()
      The integer representation of the collation strength.
      Returns:
      the integer representation
    • fromInt

      public static CollationStrength fromInt(int intRepresentation)
      Gets the order from the given integer representation.
      Parameters:
      intRepresentation - the integer representation
      Returns:
      the order