/** * * * <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; } /**
@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; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + CONFIG_FIELD_NUMBER; hash = (53 * hash) + getConfig().hashCode(); hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; hash = (53 * hash) + getDisplayName().hashCode(); hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; hash = (53 * hash) + getNodeCount(); hash = (37 * hash) + STATE_FIELD_NUMBER; hash = (53 * hash) + state_; if (!internalGetLabels().getMap().isEmpty()) { hash = (37 * hash) + LABELS_FIELD_NUMBER; hash = (53 * hash) + internalGetLabels().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
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; }
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> * 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; } /**
@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; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + CONFIG_FIELD_NUMBER; hash = (53 * hash) + getConfig().hashCode(); hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; hash = (53 * hash) + getDisplayName().hashCode(); hash = (37 * hash) + NODE_COUNT_FIELD_NUMBER; hash = (53 * hash) + getNodeCount(); hash = (37 * hash) + STATE_FIELD_NUMBER; hash = (53 * hash) + state_; if (!internalGetLabels().getMap().isEmpty()) { hash = (37 * hash) + LABELS_FIELD_NUMBER; hash = (53 * hash) + internalGetLabels().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
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; }
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(); } }