Class Collation

java.lang.Object
com.mongodb.client.model.Collation

public final class Collation extends Object
The options regarding collation support in MongoDB 3.4+
Since:
3.4
MongoDB documentation
Create Collection
Index options
Since server release
3.4
  • Method Details

    • builder

      public static Collation.Builder builder()
      Convenience method to create a Builder.
      Returns:
      a builder
    • builder

      public static Collation.Builder builder(Collation options)
      Convenience method to create a from an existing Collation.
      Parameters:
      options - create a builder from existing options
      Returns:
      a builder
    • getLocale

      @Nullable public String getLocale()
      Returns the locale
      Returns:
      the locale
      See Also:
    • getCaseLevel

      @Nullable public Boolean getCaseLevel()
      Returns the case level value
      Returns:
      the case level value
    • getCaseFirst

      @Nullable public CollationCaseFirst getCaseFirst()
      Returns the collation case first value
      Returns:
      the collation case first value
    • getStrength

      @Nullable public CollationStrength getStrength()
      Returns the collation strength
      Returns:
      the collation strength
    • getNumericOrdering

      @Nullable public Boolean getNumericOrdering()
      Returns the numeric ordering, if true will order numbers based on numerical order and not collation order.
      Returns:
      the numeric ordering
    • getAlternate

      @Nullable public CollationAlternate getAlternate()
      Returns the collation alternate
      Returns:
      the alternate
    • getMaxVariable

      @Nullable public CollationMaxVariable getMaxVariable()
      Returns the maxVariable

      Controls which characters are affected by collection alternate CollationAlternate.SHIFTED.

      Returns:
      the maxVariable
    • getNormalization

      @Nullable public Boolean getNormalization()
      Returns the normalization value

      If true, normalizes text into Unicode NFD.

      Returns:
      the normalization
    • getBackwards

      @Nullable public Boolean getBackwards()
      Returns the backwards value
      Returns:
      the backwards value
    • asDocument

      public BsonDocument asDocument()
      Gets this collation options as a document.
      Returns:
      The collation options as a BsonDocument
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object