Package com.google.cloud.spanner
Class Database.Builder
- java.lang.Object
-
- com.google.cloud.spanner.DatabaseInfo.Builder
-
- com.google.cloud.spanner.Database.Builder
-
- Enclosing class:
- Database
public static class Database.Builder extends DatabaseInfo.Builder
-
-
Field Summary
Fields Modifier and Type Field Description protected DatabaseIdid
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Databasebuild()Builds the database from this builder.DatabaseInfo.BuildersetDefaultLeader(String defaultLeader)The read-write region which will be used for the database's leader replicas.DatabaseInfo.BuildersetDialect(Dialect dialect)DatabaseInfo.BuildersetEncryptionConfig(CustomerManagedEncryption encryptionConfig)Optional for creating a new backup.
-
-
-
Field Detail
-
id
protected final DatabaseId id
-
-
Method Detail
-
build
public Database build()
Description copied from class:DatabaseInfo.BuilderBuilds the database from this builder.- Specified by:
buildin classDatabaseInfo.Builder
-
setEncryptionConfig
public DatabaseInfo.Builder setEncryptionConfig(@Nullable CustomerManagedEncryption encryptionConfig)
Description copied from class:DatabaseInfo.BuilderOptional for creating a new backup.The encryption configuration to be used for the database. The only encryption, other than Google's default encryption, is a customer managed encryption with a provided key. If no encryption is provided, Google's default encryption will be used.
- Specified by:
setEncryptionConfigin classDatabaseInfo.Builder
-
setDefaultLeader
public DatabaseInfo.Builder setDefaultLeader(String defaultLeader)
Description copied from class:DatabaseInfo.BuilderThe read-write region which will be used for the database's leader replicas. This can be one of the values as specified in https://cloud.google.com/spanner/docs/instances#available-configurations-multi-region.- Overrides:
setDefaultLeaderin classDatabaseInfo.Builder
-
setDialect
public DatabaseInfo.Builder setDialect(Dialect dialect)
- Overrides:
setDialectin classDatabaseInfo.Builder
-
-