Package com.google.cloud.spanner
Class Instance.Builder
- java.lang.Object
-
- com.google.cloud.spanner.InstanceInfo.Builder
-
- com.google.cloud.spanner.Instance.Builder
-
- Enclosing class:
- Instance
public static class Instance.Builder extends InstanceInfo.Builder
Builder ofInstance.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Instance.BuilderaddLabel(String key, String value)Instancebuild()Instance.BuilderputAllLabels(Map<String,String> labels)Instance.BuildersetDisplayName(String displayName)Instance.BuildersetInstanceConfigId(InstanceConfigId instanceConfigId)Instance.BuildersetNodeCount(int nodeCount)Sets the number of nodes for the instance.Instance.BuildersetProcessingUnits(int processingUnits)Sets the number of processing units for the instance.Instance.BuildersetState(InstanceInfo.State state)
-
-
-
Method Detail
-
setInstanceConfigId
public Instance.Builder setInstanceConfigId(InstanceConfigId instanceConfigId)
- Specified by:
setInstanceConfigIdin classInstanceInfo.Builder
-
setDisplayName
public Instance.Builder setDisplayName(String displayName)
- Specified by:
setDisplayNamein classInstanceInfo.Builder
-
setNodeCount
public Instance.Builder setNodeCount(int nodeCount)
Description copied from class:InstanceInfo.BuilderSets the number of nodes for the instance. Exactly one of processing units or node count must be set when creating a new instance.- Specified by:
setNodeCountin classInstanceInfo.Builder
-
setProcessingUnits
public Instance.Builder setProcessingUnits(int processingUnits)
Description copied from class:InstanceInfo.BuilderSets the number of processing units for the instance. Exactly one of processing units or node count must be set when creating a new instance. Processing units must be between 1 and 999 (inclusive) when creating a new instance with node count = 0. Processing units from 1000 and up must always be a multiple of 1000 (that is equal to an integer number of nodes).- Overrides:
setProcessingUnitsin classInstanceInfo.Builder
-
setState
public Instance.Builder setState(InstanceInfo.State state)
- Specified by:
setStatein classInstanceInfo.Builder
-
addLabel
public Instance.Builder addLabel(String key, String value)
- Specified by:
addLabelin classInstanceInfo.Builder
-
putAllLabels
public Instance.Builder putAllLabels(Map<String,String> labels)
- Specified by:
putAllLabelsin classInstanceInfo.Builder
-
build
public Instance build()
- Specified by:
buildin classInstanceInfo.Builder
-
-