Package io.debezium.connector.mongodb
Class CollectionId
java.lang.Object
io.debezium.connector.mongodb.CollectionId
- All Implemented Interfaces:
io.debezium.spi.schema.DataCollectionId
@Immutable
public final class CollectionId
extends Object
implements io.debezium.spi.schema.DataCollectionId
A simple identifier for collections in a replica set.
- Author:
- Randall Hauch
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCollectionId(String dbName, String collectionName) Create a new collection identifier. -
Method Summary
Modifier and TypeMethodDescriptiondbName()Get the name of the database in which the collection exists.booleaninthashCode()name()Get the name of the collection.Get the namespace of this collection, which is composed of thedatabase nameandcollection name.static CollectionIdParse the supplied<database_name>.<collection_name>string.parts()toString()
-
Field Details
-
dbName
-
name
-
-
Constructor Details
-
CollectionId
Create a new collection identifier.- Parameters:
dbName- the name of the database; may not be nullcollectionName- the name of the collection; may not be null
-
-
Method Details
-
parse
Parse the supplied<database_name>.<collection_name>string. Thecollection_namecan also contain dots in its value.- Parameters:
str- the string representation of the collection identifier; may not be null- Returns:
- the collection ID, or null if it could not be parsed
-
name
Get the name of the collection.- Returns:
- the collection's name; never null
-
dbName
Get the name of the database in which the collection exists.- Returns:
- the database name; never null
-
identifier
- Specified by:
identifierin interfaceio.debezium.spi.schema.DataCollectionId
-
parts
- Specified by:
partsin interfaceio.debezium.spi.schema.DataCollectionId
-
databaseParts
- Specified by:
databasePartsin interfaceio.debezium.spi.schema.DataCollectionId
-
schemaParts
- Specified by:
schemaPartsin interfaceio.debezium.spi.schema.DataCollectionId
-
hashCode
public int hashCode() -
equals
-
namespace
Get the namespace of this collection, which is composed of thedatabase nameandcollection name.- Returns:
- the namespace for this collection; never null
-
toString
-