Enum Class DiskUse

java.lang.Object
java.lang.Enum<DiskUse>
org.springframework.data.mongodb.core.query.DiskUse
All Implemented Interfaces:
Serializable, Comparable<DiskUse>, Constable

public enum DiskUse extends Enum<DiskUse>
Disk use indicates if the MongoDB server is allowed to write temporary files to disk during query/aggregation execution. MongoDB 6.0 server (and later) default for allowDiskUseByDefault is true on the server side.
Since:
5.0
Author:
Christoph Strobl
See Also:
  • FindIterable.allowDiskUse(Boolean)
  • FindPublisher.allowDiskUse(Boolean)
  • Enum Constant Details

    • DEFAULT

      public static final DiskUse DEFAULT
      Use the server default value and do not specify any override.
    • ALLOW

      public static final DiskUse ALLOW
      Allow disk writes.
    • DENY

      public static final DiskUse DENY
      Explicitly deny disk writes.
  • Method Details

    • values

      public static DiskUse[] 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 DiskUse 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
    • of

      public static DiskUse of(@Nullable Boolean value)
      Obtain the DiskUse corresponding to the given Boolean flag. null is considered DEFAULT, true as ALLOW, false as DENY.
      Parameters:
      value - can be null.
      Returns:
      the DiskUse corresponding to the given value.
    • of

      public static DiskUse of(@Nullable String value)
      Obtain the DiskUse referred to by the given value. Considers null or empty Strings as DEFAULT, true as ALLOW, false as DENY and delegates other values to valueOf(String).
      Parameters:
      value - can be null.
      Returns:
      the DiskUse corresponding to the given value.
      Throws:
      IllegalArgumentException - if not matching DiskUse found.