@java.lang.Override public Builder newBuilderForType() { return newBuilder(); }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.spanner.admin.instance.v1.Instance)) { return super.equals(obj); } com.google.spanner.admin.instance.v1.Instance other = (com.google.spanner.admin.instance.v1.Instance) obj; boolean result = true; result = result && getName().equals(other.getName()); result = result && getConfig().equals(other.getConfig()); result = result && getDisplayName().equals(other.getDisplayName()); result = result && (getNodeCount() == other.getNodeCount()); result = result && state_ == other.state_; result = result && internalGetLabels().equals(other.internalGetLabels()); result = result && unknownFields.equals(other.unknownFields); return result; }
public Builder mergeFrom(com.google.spanner.admin.instance.v1.Instance other) { if (other == com.google.spanner.admin.instance.v1.Instance.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged(); } if (!other.getConfig().isEmpty()) { config_ = other.config_; onChanged(); } if (!other.getDisplayName().isEmpty()) { displayName_ = other.displayName_; onChanged(); } if (other.getNodeCount() != 0) { setNodeCount(other.getNodeCount()); } if (other.state_ != 0) { setStateValue(other.getStateValue()); } internalGetMutableLabels().mergeFrom(other.internalGetLabels()); this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * * * <pre> * Required. The descriptive name for this instance as it appears in UIs. * Must be unique per project and between 4 and 30 characters in length. * </pre> * * <code>string display_name = 3;</code> */ public Builder clearDisplayName() { displayName_ = getDefaultInstance().getDisplayName(); onChanged(); return this; } /**
/** * * * <pre> * Required. The name of the instance's configuration. Values are of the form * `projects/<project>/instanceConfigs/<configuration>`. See * also [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] and * [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. * </pre> * * <code>string config = 2;</code> */ public Builder clearConfig() { config_ = getDefaultInstance().getConfig(); onChanged(); return this; } /**
static Instance fromProto( com.google.spanner.admin.instance.v1.Instance proto, InstanceAdminClient instanceClient, DatabaseAdminClient dbClient) { InstanceId id = InstanceId.of(proto.getName()); Builder builder = new Builder(instanceClient, dbClient, id) .setInstanceConfigId(InstanceConfigId.of(proto.getConfig())) .setDisplayName(proto.getDisplayName()) .setNodeCount(proto.getNodeCount()); State state; switch (proto.getState()) { case STATE_UNSPECIFIED: state = State.UNSPECIFIED; break; case CREATING: state = State.CREATING; break; case READY: state = State.READY; break; default: throw new IllegalArgumentException("Unknown state:" + proto.getState()); } builder.setState(state); builder.putAllLabels(proto.getLabelsMap()); return builder.build(); } }
@java.lang.Override public com.google.spanner.admin.instance.v1.Instance getDefaultInstanceForType() { return com.google.spanner.admin.instance.v1.Instance.getDefaultInstance(); }
/** * * * <pre> * Required. A unique identifier for the instance, which cannot be changed * after the instance is created. Values are of the form * `projects/<project>/instances/[a-z][-a-z0-9]*[a-z0-9]`. The final * segment of the name must be between 6 and 30 characters in length. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
@Override public OperationFuture<Instance, UpdateInstanceMetadata> updateInstance( Instance instance, FieldMask fieldMask) throws SpannerException { UpdateInstanceRequest request = UpdateInstanceRequest.newBuilder().setInstance(instance).setFieldMask(fieldMask).build(); GrpcCallContext context = newCallContext(null, instance.getName()); return instanceAdminStub.updateInstanceOperationCallable().futureCall(request, context); }
/** Use {@link #getLabelsMap()} instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getLabels() { return getLabelsMap(); } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.spanner.admin.instance.v1.CreateInstanceRequest)) { return super.equals(obj); } com.google.spanner.admin.instance.v1.CreateInstanceRequest other = (com.google.spanner.admin.instance.v1.CreateInstanceRequest) obj; boolean result = true; result = result && getParent().equals(other.getParent()); result = result && getInstanceId().equals(other.getInstanceId()); result = result && (hasInstance() == other.hasInstance()); if (hasInstance()) { result = result && getInstance().equals(other.getInstance()); } result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public com.google.spanner.admin.instance.v1.Instance buildPartial() { com.google.spanner.admin.instance.v1.Instance result = new com.google.spanner.admin.instance.v1.Instance(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.name_ = name_; result.config_ = config_; result.displayName_ = displayName_; result.nodeCount_ = nodeCount_; result.state_ = state_; result.labels_ = internalGetLabels(); result.labels_.makeImmutable(); result.bitField0_ = to_bitField0_; onBuilt(); return result; }
static Instance fromProto( com.google.spanner.admin.instance.v1.Instance proto, InstanceAdminClient instanceClient, DatabaseAdminClient dbClient) { InstanceId id = InstanceId.of(proto.getName()); Builder builder = new Builder(instanceClient, dbClient, id) .setInstanceConfigId(InstanceConfigId.of(proto.getConfig())) .setDisplayName(proto.getDisplayName()) .setNodeCount(proto.getNodeCount()); State state; switch (proto.getState()) { case STATE_UNSPECIFIED: state = State.UNSPECIFIED; break; case CREATING: state = State.CREATING; break; case READY: state = State.READY; break; default: throw new IllegalArgumentException("Unknown state:" + proto.getState()); } builder.setState(state); builder.putAllLabels(proto.getLabelsMap()); return builder.build(); } }
/** * * * <pre> * The instance being created. * </pre> * * <code>.google.spanner.admin.instance.v1.Instance instance = 1;</code> */ public com.google.spanner.admin.instance.v1.Instance getInstance() { return instance_ == null ? com.google.spanner.admin.instance.v1.Instance.getDefaultInstance() : instance_; } /**
/** * * * <pre> * Required. The descriptive name for this instance as it appears in UIs. * Must be unique per project and between 4 and 30 characters in length. * </pre> * * <code>string display_name = 3;</code> */ public Builder clearDisplayName() { displayName_ = getDefaultInstance().getDisplayName(); onChanged(); return this; } /**
/** * * * <pre> * Required. The name of the instance's configuration. Values are of the form * `projects/<project>/instanceConfigs/<configuration>`. See * also [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] and * [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs]. * </pre> * * <code>string config = 2;</code> */ public Builder clearConfig() { config_ = getDefaultInstance().getConfig(); onChanged(); return this; } /**
/** * * * <pre> * Required. A unique identifier for the instance, which cannot be changed * after the instance is created. Values are of the form * `projects/<project>/instances/[a-z][-a-z0-9]*[a-z0-9]`. The final * segment of the name must be between 6 and 30 characters in length. * </pre> * * <code>string name = 1;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
@Override public OperationFuture<Instance, UpdateInstanceMetadata> updateInstance( Instance instance, FieldMask fieldMask) throws SpannerException { UpdateInstanceRequest request = UpdateInstanceRequest.newBuilder().setInstance(instance).setFieldMask(fieldMask).build(); GrpcCallContext context = newCallContext(null, instance.getName()); return instanceAdminStub.updateInstanceOperationCallable().futureCall(request, context); }
/** Use {@link #getLabelsMap()} instead. */ @java.lang.Deprecated public java.util.Map<java.lang.String, java.lang.String> getLabels() { return getLabelsMap(); } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.spanner.admin.instance.v1.UpdateInstanceRequest)) { return super.equals(obj); } com.google.spanner.admin.instance.v1.UpdateInstanceRequest other = (com.google.spanner.admin.instance.v1.UpdateInstanceRequest) obj; boolean result = true; result = result && (hasInstance() == other.hasInstance()); if (hasInstance()) { result = result && getInstance().equals(other.getInstance()); } result = result && (hasFieldMask() == other.hasFieldMask()); if (hasFieldMask()) { result = result && getFieldMask().equals(other.getFieldMask()); } result = result && unknownFields.equals(other.unknownFields); return result; }