Record Class BulkOperationContext.TypedNamespace

java.lang.Object
java.lang.Record
org.springframework.data.mongodb.core.bulk.BulkOperationContext.TypedNamespace
Record Components:
type - target domain type for mapping queries and updates; used to derive collection name when collection is null; may be null.
database - target database; use null for the configured default database.
collectionName - target collection name; may be null.
Enclosing interface:
BulkOperationContext

public static record BulkOperationContext.TypedNamespace(@Nullable Class<?> type, @Nullable String database, @Nullable CollectionName collectionName) extends Record
Value object holding namespace (database and collection) information and an optional domain type used for mapping bulk operations.

NOTE: Provide at least either type or collection. An explicit collection name takes precedence over the collection name derived from type.

Since:
5.1
Author:
Christoph Strobl
  • Constructor Details

    • TypedNamespace

      public TypedNamespace(@Nullable Class<?> type, @Nullable String database, @Nullable CollectionName collectionName)
      Creates an instance of a TypedNamespace record class.
      Parameters:
      type - the value for the type record component
      database - the value for the database record component
      collectionName - the value for the collectionName record component
  • Method Details

    • hasCollectionName

      public boolean hasCollectionName()
    • getRequiredCollectionName

      public CollectionName getRequiredCollectionName()
    • getDomainType

      public Class<?> getDomainType()
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • type

      public @Nullable Class<?> type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • database

      public @Nullable String database()
      Returns the value of the database record component.
      Returns:
      the value of the database record component
    • collectionName

      public @Nullable CollectionName collectionName()
      Returns the value of the collectionName record component.
      Returns:
      the value of the collectionName record component