Class Collation


  • public class Collation
    extends java.lang.Object
    The options regarding collation support in MongoDB 3.4+
    Since:
    3.4
    Since server release
    3.4
    MongoDB documentation
    Create Collection
    Index options
    • Constructor Detail

      • Collation

        public Collation()
      • Collation

        public Collation​(JsonObject json)
    • Method Detail

      • setLocale

        public Collation setLocale​(java.lang.String locale)
        Sets the locale
        Parameters:
        locale - the locale
        Returns:
        this
        See Also:
        ICU User Guide - Locale
      • getLocale

        public java.lang.String getLocale()
        Returns the locale
        Returns:
        the locale
        See Also:
        ICU User Guide - Locale
      • setCaseLevel

        public Collation setCaseLevel​(java.lang.Boolean caseLevel)
        Sets the case level value

        Turns on case sensitivity

        Parameters:
        caseLevel - the case level value
        Returns:
        this
      • isCaseLevel

        public java.lang.Boolean isCaseLevel()
        Returns the case level value
        Returns:
        the case level value
      • setCaseFirst

        public Collation setCaseFirst​(CollationCaseFirst caseFirst)
        Sets the collation case first value

        Determines if Uppercase or lowercase values should come first

        Parameters:
        caseFirst - the collation case first value
        Returns:
        this
      • getCaseFirst

        public CollationCaseFirst getCaseFirst()
        Returns the collation case first value
        Returns:
        the collation case first value
      • setStrength

        public Collation setStrength​(CollationStrength strength)
        Sets the collation strength
        Parameters:
        strength - the strength
        Returns:
        this
      • getStrength

        public CollationStrength getStrength()
        Returns the collation strength
        Returns:
        the collation strength
      • setNumericOrdering

        public Collation setNumericOrdering​(java.lang.Boolean numericOrdering)
        Sets the numeric ordering
        Parameters:
        numericOrdering - if true will order numbers based on numerical order and not collation order
        Returns:
        this
      • isNumericOrdering

        public java.lang.Boolean isNumericOrdering()
        Returns the numeric ordering, if true will order numbers based on numerical order and not collation order.
        Returns:
        the numeric ordering
      • setAlternate

        public Collation setAlternate​(CollationAlternate alternate)
        Sets the alternate

        Controls whether spaces and punctuation are considered base characters

        Parameters:
        alternate - the alternate
        Returns:
        this
      • getAlternate

        public CollationAlternate getAlternate()
        Returns the collation alternate
        Returns:
        the alternate
      • setMaxVariable

        public Collation setMaxVariable​(CollationMaxVariable maxVariable)
        Sets the maxVariable
        Parameters:
        maxVariable - the maxVariable
        Returns:
        this
      • setNormalization

        public Collation setNormalization​(java.lang.Boolean normalization)
        Sets the normalization value

        If true, normalizes text into Unicode NFD.

        Parameters:
        normalization - the normalization value
        Returns:
        this
      • isNormalization

        public java.lang.Boolean isNormalization()
        Returns the normalization value

        If true, normalizes text into Unicode NFD.

        Returns:
        the normalization
      • setBackwards

        public Collation setBackwards​(java.lang.Boolean backwards)
        Sets the backwards value

        Causes secondary differences to be considered in reverse order, as it is done in the French language

        Parameters:
        backwards - the backwards value
        Returns:
        this
      • isBackwards

        public java.lang.Boolean isBackwards()
        Returns the backwards value
        Returns:
        the backwards value