Package com.mongodb

Enum ReadConcernLevel

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ReadConcernLevel>

    public enum ReadConcernLevel
    extends java.lang.Enum<ReadConcernLevel>
    A read concern level allows clients to choose a level of isolation for their reads.
    Since:
    3.2
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      AVAILABLE
      The available read concern level.
      LINEARIZABLE
      The linearizable read concern level.
      LOCAL
      The local read concern level.
      MAJORITY
      The majority read concern level.
      SNAPSHOT
      The snapshot read concern level.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static ReadConcernLevel fromString​(java.lang.String readConcernLevel)
      Returns the ReadConcern from the string read concern level.
      java.lang.String getValue()  
      static ReadConcernLevel valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static ReadConcernLevel[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • LOCAL

        public static final ReadConcernLevel LOCAL
        The local read concern level.
      • MAJORITY

        public static final ReadConcernLevel MAJORITY
        The majority read concern level.
      • SNAPSHOT

        public static final ReadConcernLevel SNAPSHOT
        The snapshot read concern level.
        Since:
        3.8
      • AVAILABLE

        public static final ReadConcernLevel AVAILABLE
        The available read concern level.
        Since:
        3.9
    • Method Detail

      • values

        public static ReadConcernLevel[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ReadConcernLevel c : ReadConcernLevel.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ReadConcernLevel valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getValue

        public java.lang.String getValue()
        Returns:
        the String representation of the read concern level that the MongoDB server understands or null for the default
      • fromString

        public static ReadConcernLevel fromString​(java.lang.String readConcernLevel)
        Returns the ReadConcern from the string read concern level.
        Parameters:
        readConcernLevel - the read concern level string.
        Returns:
        the read concern