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 TypeMethodDescriptionboolean
Returns the database id.Returns the instance id for this database.getName()
Returns the name of this database.int
hashCode()
static DatabaseId
of
(InstanceId instanceId, String database) Creates aDatabaseId
given the instance identity and database id.static DatabaseId
Creates aDatabaseId
from the name of the database.static DatabaseId
Creates aDatabaseId
given 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 aDatabaseId
from the name of the database.- Parameters:
name
- the database name of the formprojects/PROJECT_ID/instances/INSTANCE_ID/databases/DATABASE_ID
- Throws:
IllegalArgumentException
- ifname
does not conform to the expected pattern
-
of
Creates aDatabaseId
given project, instance and database IDs. -
of
Creates aDatabaseId
given the instance identity and database id.
-