Class DatabaseId (6.25.1)

public final class DatabaseId

Represents an id of a Cloud Spanner database resource.

Inheritance

Object > DatabaseId

Static Methods

of(InstanceId instanceId, String database)

public static DatabaseId of(InstanceId instanceId, String database)

Creates a DatabaseId given the instance identity and database id.

Parameters
NameDescription
instanceIdInstanceId
databaseString
Returns
TypeDescription
DatabaseId

of(String name)

public static DatabaseId of(String name)

Creates a DatabaseId from the name of the database.

Parameter
NameDescription
nameString

the database name of the form projects/PROJECT_ID/instances/INSTANCE_ID/databases/DATABASE_ID

Returns
TypeDescription
DatabaseId

of(String project, String instance, String database)

public static DatabaseId of(String project, String instance, String database)

Creates a DatabaseId given project, instance and database IDs.

Parameters
NameDescription
projectString
instanceString
databaseString
Returns
TypeDescription
DatabaseId

Methods

equals(Object o)

public boolean equals(Object o)
Parameter
NameDescription
oObject
Returns
TypeDescription
boolean
Overrides

getDatabase()

public String getDatabase()

Returns the database id.

Returns
TypeDescription
String

getInstanceId()

public InstanceId getInstanceId()

Returns the instance id for this database.

Returns
TypeDescription
InstanceId

getName()

public String getName()

Returns the name of this database.

Returns
TypeDescription
String

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

toString()

public String toString()
Returns
TypeDescription
String
Overrides