Package com.google.cloud.spanner
Class DatabaseId
java.lang.Object
com.google.cloud.spanner.DatabaseId
Represents an id of a Cloud Spanner database resource.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the database id.Returns the instance id for this database.getName()Returns the name of this database.inthashCode()static DatabaseIdof(InstanceId instanceId, String database) Creates aDatabaseIdgiven the instance identity and database id.static DatabaseIdCreates aDatabaseIdfrom the name of the database.static DatabaseIdCreates aDatabaseIdgiven project, instance and database IDs.toString()
-
Method Details
-
getInstanceId
Returns the instance id for this database. -
getDatabase
Returns the database id. -
getName
Returns the name of this database. -
hashCode
public int hashCode() -
equals
-
toString
-
of
Creates aDatabaseIdfrom the name of the database.- Parameters:
name- the database name of the formprojects/PROJECT_ID/instances/INSTANCE_ID/databases/DATABASE_ID- Throws:
IllegalArgumentException- ifnamedoes not conform to the expected pattern
-
of
Creates aDatabaseIdgiven project, instance and database IDs. -
of
Creates aDatabaseIdgiven the instance identity and database id.
-