Enum Class NamespaceType

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

public enum NamespaceType extends Enum<NamespaceType>
Represents the type of the newly created namespace object in change stream events.

Only present for operations of type create and when the showExpandedEvents change stream option is enabled.

Since:
5.6
Since server release
8.1
  • Enum Constant Details

    • COLLECTION

      public static final NamespaceType COLLECTION
      The collection namespace type.
    • TIMESERIES

      public static final NamespaceType TIMESERIES
      The timeseries namespace type.
    • VIEW

      public static final NamespaceType VIEW
      The view namespace type.
    • OTHER

      public static final NamespaceType OTHER
      The other namespace type.

      A placeholder for newer namespace types issued by the server. Users encountering OTHER namespace types are advised to update the driver to get the actual namespace type.

  • Method Details

    • values

      public static NamespaceType[] 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 NamespaceType 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
    • getValue

      public String getValue()
      Returns:
      the String representation of the namespace type
    • fromString

      public static NamespaceType fromString(@Nullable String namespaceTypeName)
      Returns the ChangeStreamNamespaceType from the string value.
      Parameters:
      namespaceTypeName - the string value.
      Returns:
      the namespace type.
    • toString

      public String toString()
      Overrides:
      toString in class Enum<NamespaceType>