com.google.cloud.baremetalsolution.v2.Network Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-google-cloud-bare-metal-solution-v2 Show documentation
Show all versions of proto-google-cloud-bare-metal-solution-v2 Show documentation
Proto library for google-cloud-bare-metal-solution
/*
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/baremetalsolution/v2/network.proto
package com.google.cloud.baremetalsolution.v2;
/**
*
*
*
* A Network.
*
*
* Protobuf type {@code google.cloud.baremetalsolution.v2.Network}
*/
public final class Network extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.baremetalsolution.v2.Network)
NetworkOrBuilder {
private static final long serialVersionUID = 0L;
// Use Network.newBuilder() to construct.
private Network(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private Network() {
name_ = "";
id_ = "";
type_ = 0;
ipAddress_ = "";
macAddress_ = com.google.protobuf.LazyStringArrayList.emptyList();
state_ = 0;
vlanId_ = "";
cidr_ = "";
servicesCidr_ = "";
reservations_ = java.util.Collections.emptyList();
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new Network();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.baremetalsolution.v2.NetworkProto
.internal_static_google_cloud_baremetalsolution_v2_Network_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Override
protected com.google.protobuf.MapField internalGetMapField(int number) {
switch (number) {
case 11:
return internalGetLabels();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.baremetalsolution.v2.NetworkProto
.internal_static_google_cloud_baremetalsolution_v2_Network_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.baremetalsolution.v2.Network.class,
com.google.cloud.baremetalsolution.v2.Network.Builder.class);
}
/**
*
*
*
* Network type.
*
*
* Protobuf enum {@code google.cloud.baremetalsolution.v2.Network.Type}
*/
public enum Type implements com.google.protobuf.ProtocolMessageEnum {
/**
*
*
*
* Unspecified value.
*
*
* TYPE_UNSPECIFIED = 0;
*/
TYPE_UNSPECIFIED(0),
/**
*
*
*
* Client network, a network peered to a Google Cloud VPC.
*
*
* CLIENT = 1;
*/
CLIENT(1),
/**
*
*
*
* Private network, a network local to the Bare Metal Solution environment.
*
*
* PRIVATE = 2;
*/
PRIVATE(2),
UNRECOGNIZED(-1),
;
/**
*
*
*
* Unspecified value.
*
*
* TYPE_UNSPECIFIED = 0;
*/
public static final int TYPE_UNSPECIFIED_VALUE = 0;
/**
*
*
*
* Client network, a network peered to a Google Cloud VPC.
*
*
* CLIENT = 1;
*/
public static final int CLIENT_VALUE = 1;
/**
*
*
*
* Private network, a network local to the Bare Metal Solution environment.
*
*
* PRIVATE = 2;
*/
public static final int PRIVATE_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static Type valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static Type forNumber(int value) {
switch (value) {
case 0:
return TYPE_UNSPECIFIED;
case 1:
return CLIENT;
case 2:
return PRIVATE;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public Type findValueByNumber(int number) {
return Type.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
return com.google.cloud.baremetalsolution.v2.Network.getDescriptor().getEnumTypes().get(0);
}
private static final Type[] VALUES = values();
public static Type valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private Type(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.cloud.baremetalsolution.v2.Network.Type)
}
/**
*
*
*
* The possible states for this Network.
*
*
* Protobuf enum {@code google.cloud.baremetalsolution.v2.Network.State}
*/
public enum State implements com.google.protobuf.ProtocolMessageEnum {
/**
*
*
*
* The Network is in an unknown state.
*
*
* STATE_UNSPECIFIED = 0;
*/
STATE_UNSPECIFIED(0),
/**
*
*
*
* The Network is provisioning.
*
*
* PROVISIONING = 1;
*/
PROVISIONING(1),
/**
*
*
*
* The Network has been provisioned.
*
*
* PROVISIONED = 2;
*/
PROVISIONED(2),
UNRECOGNIZED(-1),
;
/**
*
*
*
* The Network is in an unknown state.
*
*
* STATE_UNSPECIFIED = 0;
*/
public static final int STATE_UNSPECIFIED_VALUE = 0;
/**
*
*
*
* The Network is provisioning.
*
*
* PROVISIONING = 1;
*/
public static final int PROVISIONING_VALUE = 1;
/**
*
*
*
* The Network has been provisioned.
*
*
* PROVISIONED = 2;
*/
public static final int PROVISIONED_VALUE = 2;
public final int getNumber() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalArgumentException(
"Can't get the number of an unknown enum value.");
}
return value;
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static State valueOf(int value) {
return forNumber(value);
}
/**
* @param value The numeric wire value of the corresponding enum entry.
* @return The enum associated with the given numeric wire value.
*/
public static State forNumber(int value) {
switch (value) {
case 0:
return STATE_UNSPECIFIED;
case 1:
return PROVISIONING;
case 2:
return PROVISIONED;
default:
return null;
}
}
public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() {
return internalValueMap;
}
private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap =
new com.google.protobuf.Internal.EnumLiteMap() {
public State findValueByNumber(int number) {
return State.forNumber(number);
}
};
public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() {
if (this == UNRECOGNIZED) {
throw new java.lang.IllegalStateException(
"Can't get the descriptor of an unrecognized enum value.");
}
return getDescriptor().getValues().get(ordinal());
}
public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() {
return getDescriptor();
}
public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() {
return com.google.cloud.baremetalsolution.v2.Network.getDescriptor().getEnumTypes().get(1);
}
private static final State[] VALUES = values();
public static State valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
if (desc.getType() != getDescriptor()) {
throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type.");
}
if (desc.getIndex() == -1) {
return UNRECOGNIZED;
}
return VALUES[desc.getIndex()];
}
private final int value;
private State(int value) {
this.value = value;
}
// @@protoc_insertion_point(enum_scope:google.cloud.baremetalsolution.v2.Network.State)
}
public static final int NAME_FIELD_NUMBER = 5;
@SuppressWarnings("serial")
private volatile java.lang.Object name_ = "";
/**
*
*
*
* Output only. The resource name of this `Network`.
* Resource names are schemeless URIs that follow the conventions in
* https://cloud.google.com/apis/design/resource_names.
* Format:
* `projects/{project}/locations/{location}/networks/{network}`
*
*
* string name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return The name.
*/
@java.lang.Override
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
*
*
*
* Output only. The resource name of this `Network`.
* Resource names are schemeless URIs that follow the conventions in
* https://cloud.google.com/apis/design/resource_names.
* Format:
* `projects/{project}/locations/{location}/networks/{network}`
*
*
* string name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return The bytes for name.
*/
@java.lang.Override
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ID_FIELD_NUMBER = 10;
@SuppressWarnings("serial")
private volatile java.lang.Object id_ = "";
/**
*
*
*
* An identifier for the `Network`, generated by the backend.
*
*
* string id = 10;
*
* @return The id.
*/
@java.lang.Override
public java.lang.String getId() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
id_ = s;
return s;
}
}
/**
*
*
*
* An identifier for the `Network`, generated by the backend.
*
*
* string id = 10;
*
* @return The bytes for id.
*/
@java.lang.Override
public com.google.protobuf.ByteString getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TYPE_FIELD_NUMBER = 2;
private int type_ = 0;
/**
*
*
*
* The type of this network.
*
*
* .google.cloud.baremetalsolution.v2.Network.Type type = 2;
*
* @return The enum numeric value on the wire for type.
*/
@java.lang.Override
public int getTypeValue() {
return type_;
}
/**
*
*
*
* The type of this network.
*
*
* .google.cloud.baremetalsolution.v2.Network.Type type = 2;
*
* @return The type.
*/
@java.lang.Override
public com.google.cloud.baremetalsolution.v2.Network.Type getType() {
com.google.cloud.baremetalsolution.v2.Network.Type result =
com.google.cloud.baremetalsolution.v2.Network.Type.forNumber(type_);
return result == null
? com.google.cloud.baremetalsolution.v2.Network.Type.UNRECOGNIZED
: result;
}
public static final int IP_ADDRESS_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private volatile java.lang.Object ipAddress_ = "";
/**
*
*
*
* IP address configured.
*
*
* string ip_address = 3;
*
* @return The ipAddress.
*/
@java.lang.Override
public java.lang.String getIpAddress() {
java.lang.Object ref = ipAddress_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
ipAddress_ = s;
return s;
}
}
/**
*
*
*
* IP address configured.
*
*
* string ip_address = 3;
*
* @return The bytes for ipAddress.
*/
@java.lang.Override
public com.google.protobuf.ByteString getIpAddressBytes() {
java.lang.Object ref = ipAddress_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
ipAddress_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int MAC_ADDRESS_FIELD_NUMBER = 4;
@SuppressWarnings("serial")
private com.google.protobuf.LazyStringArrayList macAddress_ =
com.google.protobuf.LazyStringArrayList.emptyList();
/**
*
*
*
* List of physical interfaces.
*
*
* repeated string mac_address = 4;
*
* @return A list containing the macAddress.
*/
public com.google.protobuf.ProtocolStringList getMacAddressList() {
return macAddress_;
}
/**
*
*
*
* List of physical interfaces.
*
*
* repeated string mac_address = 4;
*
* @return The count of macAddress.
*/
public int getMacAddressCount() {
return macAddress_.size();
}
/**
*
*
*
* List of physical interfaces.
*
*
* repeated string mac_address = 4;
*
* @param index The index of the element to return.
* @return The macAddress at the given index.
*/
public java.lang.String getMacAddress(int index) {
return macAddress_.get(index);
}
/**
*
*
*
* List of physical interfaces.
*
*
* repeated string mac_address = 4;
*
* @param index The index of the value to return.
* @return The bytes of the macAddress at the given index.
*/
public com.google.protobuf.ByteString getMacAddressBytes(int index) {
return macAddress_.getByteString(index);
}
public static final int STATE_FIELD_NUMBER = 6;
private int state_ = 0;
/**
*
*
*
* The Network state.
*
*
* .google.cloud.baremetalsolution.v2.Network.State state = 6;
*
* @return The enum numeric value on the wire for state.
*/
@java.lang.Override
public int getStateValue() {
return state_;
}
/**
*
*
*
* The Network state.
*
*
* .google.cloud.baremetalsolution.v2.Network.State state = 6;
*
* @return The state.
*/
@java.lang.Override
public com.google.cloud.baremetalsolution.v2.Network.State getState() {
com.google.cloud.baremetalsolution.v2.Network.State result =
com.google.cloud.baremetalsolution.v2.Network.State.forNumber(state_);
return result == null
? com.google.cloud.baremetalsolution.v2.Network.State.UNRECOGNIZED
: result;
}
public static final int VLAN_ID_FIELD_NUMBER = 7;
@SuppressWarnings("serial")
private volatile java.lang.Object vlanId_ = "";
/**
*
*
*
* The vlan id of the Network.
*
*
* string vlan_id = 7;
*
* @return The vlanId.
*/
@java.lang.Override
public java.lang.String getVlanId() {
java.lang.Object ref = vlanId_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
vlanId_ = s;
return s;
}
}
/**
*
*
*
* The vlan id of the Network.
*
*
* string vlan_id = 7;
*
* @return The bytes for vlanId.
*/
@java.lang.Override
public com.google.protobuf.ByteString getVlanIdBytes() {
java.lang.Object ref = vlanId_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
vlanId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CIDR_FIELD_NUMBER = 8;
@SuppressWarnings("serial")
private volatile java.lang.Object cidr_ = "";
/**
*
*
*
* The cidr of the Network.
*
*
* string cidr = 8;
*
* @return The cidr.
*/
@java.lang.Override
public java.lang.String getCidr() {
java.lang.Object ref = cidr_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
cidr_ = s;
return s;
}
}
/**
*
*
*
* The cidr of the Network.
*
*
* string cidr = 8;
*
* @return The bytes for cidr.
*/
@java.lang.Override
public com.google.protobuf.ByteString getCidrBytes() {
java.lang.Object ref = cidr_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
cidr_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int VRF_FIELD_NUMBER = 9;
private com.google.cloud.baremetalsolution.v2.VRF vrf_;
/**
*
*
*
* The vrf for the Network.
*
*
* .google.cloud.baremetalsolution.v2.VRF vrf = 9;
*
* @return Whether the vrf field is set.
*/
@java.lang.Override
public boolean hasVrf() {
return vrf_ != null;
}
/**
*
*
*
* The vrf for the Network.
*
*
* .google.cloud.baremetalsolution.v2.VRF vrf = 9;
*
* @return The vrf.
*/
@java.lang.Override
public com.google.cloud.baremetalsolution.v2.VRF getVrf() {
return vrf_ == null ? com.google.cloud.baremetalsolution.v2.VRF.getDefaultInstance() : vrf_;
}
/**
*
*
*
* The vrf for the Network.
*
*
* .google.cloud.baremetalsolution.v2.VRF vrf = 9;
*/
@java.lang.Override
public com.google.cloud.baremetalsolution.v2.VRFOrBuilder getVrfOrBuilder() {
return vrf_ == null ? com.google.cloud.baremetalsolution.v2.VRF.getDefaultInstance() : vrf_;
}
public static final int LABELS_FIELD_NUMBER = 11;
private static final class LabelsDefaultEntryHolder {
static final com.google.protobuf.MapEntry defaultEntry =
com.google.protobuf.MapEntry.newDefaultInstance(
com.google.cloud.baremetalsolution.v2.NetworkProto
.internal_static_google_cloud_baremetalsolution_v2_Network_LabelsEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.STRING,
"");
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField labels_;
private com.google.protobuf.MapField internalGetLabels() {
if (labels_ == null) {
return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
}
return labels_;
}
public int getLabelsCount() {
return internalGetLabels().getMap().size();
}
/**
*
*
*
* Labels as key value pairs.
*
*
* map<string, string> labels = 11;
*/
@java.lang.Override
public boolean containsLabels(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetLabels().getMap().containsKey(key);
}
/** Use {@link #getLabelsMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getLabels() {
return getLabelsMap();
}
/**
*
*
*
* Labels as key value pairs.
*
*
* map<string, string> labels = 11;
*/
@java.lang.Override
public java.util.Map getLabelsMap() {
return internalGetLabels().getMap();
}
/**
*
*
*
* Labels as key value pairs.
*
*
* map<string, string> labels = 11;
*/
@java.lang.Override
public /* nullable */ java.lang.String getLabelsOrDefault(
java.lang.String key,
/* nullable */
java.lang.String defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetLabels().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
*
*
* Labels as key value pairs.
*
*
* map<string, string> labels = 11;
*/
@java.lang.Override
public java.lang.String getLabelsOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetLabels().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public static final int SERVICES_CIDR_FIELD_NUMBER = 12;
@SuppressWarnings("serial")
private volatile java.lang.Object servicesCidr_ = "";
/**
*
*
*
* IP range for reserved for services (e.g. NFS).
*
*
* string services_cidr = 12;
*
* @return The servicesCidr.
*/
@java.lang.Override
public java.lang.String getServicesCidr() {
java.lang.Object ref = servicesCidr_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
servicesCidr_ = s;
return s;
}
}
/**
*
*
*
* IP range for reserved for services (e.g. NFS).
*
*
* string services_cidr = 12;
*
* @return The bytes for servicesCidr.
*/
@java.lang.Override
public com.google.protobuf.ByteString getServicesCidrBytes() {
java.lang.Object ref = servicesCidr_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
servicesCidr_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int RESERVATIONS_FIELD_NUMBER = 13;
@SuppressWarnings("serial")
private java.util.List
reservations_;
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
@java.lang.Override
public java.util.List
getReservationsList() {
return reservations_;
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
@java.lang.Override
public java.util.List<
? extends com.google.cloud.baremetalsolution.v2.NetworkAddressReservationOrBuilder>
getReservationsOrBuilderList() {
return reservations_;
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
@java.lang.Override
public int getReservationsCount() {
return reservations_.size();
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
@java.lang.Override
public com.google.cloud.baremetalsolution.v2.NetworkAddressReservation getReservations(
int index) {
return reservations_.get(index);
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
@java.lang.Override
public com.google.cloud.baremetalsolution.v2.NetworkAddressReservationOrBuilder
getReservationsOrBuilder(int index) {
return reservations_.get(index);
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (type_ != com.google.cloud.baremetalsolution.v2.Network.Type.TYPE_UNSPECIFIED.getNumber()) {
output.writeEnum(2, type_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, ipAddress_);
}
for (int i = 0; i < macAddress_.size(); i++) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, macAddress_.getRaw(i));
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, name_);
}
if (state_
!= com.google.cloud.baremetalsolution.v2.Network.State.STATE_UNSPECIFIED.getNumber()) {
output.writeEnum(6, state_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(vlanId_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 7, vlanId_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cidr_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 8, cidr_);
}
if (vrf_ != null) {
output.writeMessage(9, getVrf());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 10, id_);
}
com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
output, internalGetLabels(), LabelsDefaultEntryHolder.defaultEntry, 11);
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servicesCidr_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 12, servicesCidr_);
}
for (int i = 0; i < reservations_.size(); i++) {
output.writeMessage(13, reservations_.get(i));
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (type_ != com.google.cloud.baremetalsolution.v2.Network.Type.TYPE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, type_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(ipAddress_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, ipAddress_);
}
{
int dataSize = 0;
for (int i = 0; i < macAddress_.size(); i++) {
dataSize += computeStringSizeNoTag(macAddress_.getRaw(i));
}
size += dataSize;
size += 1 * getMacAddressList().size();
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(name_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, name_);
}
if (state_
!= com.google.cloud.baremetalsolution.v2.Network.State.STATE_UNSPECIFIED.getNumber()) {
size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, state_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(vlanId_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, vlanId_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(cidr_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, cidr_);
}
if (vrf_ != null) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(9, getVrf());
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, id_);
}
for (java.util.Map.Entry entry :
internalGetLabels().getMap().entrySet()) {
com.google.protobuf.MapEntry labels__ =
LabelsDefaultEntryHolder.defaultEntry
.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream.computeMessageSize(11, labels__);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(servicesCidr_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, servicesCidr_);
}
for (int i = 0; i < reservations_.size(); i++) {
size += com.google.protobuf.CodedOutputStream.computeMessageSize(13, reservations_.get(i));
}
size += getUnknownFields().getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.google.cloud.baremetalsolution.v2.Network)) {
return super.equals(obj);
}
com.google.cloud.baremetalsolution.v2.Network other =
(com.google.cloud.baremetalsolution.v2.Network) obj;
if (!getName().equals(other.getName())) return false;
if (!getId().equals(other.getId())) return false;
if (type_ != other.type_) return false;
if (!getIpAddress().equals(other.getIpAddress())) return false;
if (!getMacAddressList().equals(other.getMacAddressList())) return false;
if (state_ != other.state_) return false;
if (!getVlanId().equals(other.getVlanId())) return false;
if (!getCidr().equals(other.getCidr())) return false;
if (hasVrf() != other.hasVrf()) return false;
if (hasVrf()) {
if (!getVrf().equals(other.getVrf())) return false;
}
if (!internalGetLabels().equals(other.internalGetLabels())) return false;
if (!getServicesCidr().equals(other.getServicesCidr())) return false;
if (!getReservationsList().equals(other.getReservationsList())) return false;
if (!getUnknownFields().equals(other.getUnknownFields())) return false;
return true;
}
@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) + ID_FIELD_NUMBER;
hash = (53 * hash) + getId().hashCode();
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + type_;
hash = (37 * hash) + IP_ADDRESS_FIELD_NUMBER;
hash = (53 * hash) + getIpAddress().hashCode();
if (getMacAddressCount() > 0) {
hash = (37 * hash) + MAC_ADDRESS_FIELD_NUMBER;
hash = (53 * hash) + getMacAddressList().hashCode();
}
hash = (37 * hash) + STATE_FIELD_NUMBER;
hash = (53 * hash) + state_;
hash = (37 * hash) + VLAN_ID_FIELD_NUMBER;
hash = (53 * hash) + getVlanId().hashCode();
hash = (37 * hash) + CIDR_FIELD_NUMBER;
hash = (53 * hash) + getCidr().hashCode();
if (hasVrf()) {
hash = (37 * hash) + VRF_FIELD_NUMBER;
hash = (53 * hash) + getVrf().hashCode();
}
if (!internalGetLabels().getMap().isEmpty()) {
hash = (37 * hash) + LABELS_FIELD_NUMBER;
hash = (53 * hash) + internalGetLabels().hashCode();
}
hash = (37 * hash) + SERVICES_CIDR_FIELD_NUMBER;
hash = (53 * hash) + getServicesCidr().hashCode();
if (getReservationsCount() > 0) {
hash = (37 * hash) + RESERVATIONS_FIELD_NUMBER;
hash = (53 * hash) + getReservationsList().hashCode();
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.baremetalsolution.v2.Network parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.baremetalsolution.v2.Network parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.baremetalsolution.v2.Network parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.baremetalsolution.v2.Network parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.baremetalsolution.v2.Network parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.baremetalsolution.v2.Network parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.baremetalsolution.v2.Network parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.baremetalsolution.v2.Network parseFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.baremetalsolution.v2.Network parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.baremetalsolution.v2.Network parseDelimitedFrom(
java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(
PARSER, input, extensionRegistry);
}
public static com.google.cloud.baremetalsolution.v2.Network parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.baremetalsolution.v2.Network parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(
PARSER, input, extensionRegistry);
}
@java.lang.Override
public Builder newBuilderForType() {
return newBuilder();
}
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(com.google.cloud.baremetalsolution.v2.Network prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
@java.lang.Override
public Builder toBuilder() {
return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
*
*
*
* A Network.
*
*
* Protobuf type {@code google.cloud.baremetalsolution.v2.Network}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.baremetalsolution.v2.Network)
com.google.cloud.baremetalsolution.v2.NetworkOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.baremetalsolution.v2.NetworkProto
.internal_static_google_cloud_baremetalsolution_v2_Network_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMapField(int number) {
switch (number) {
case 11:
return internalGetLabels();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMutableMapField(int number) {
switch (number) {
case 11:
return internalGetMutableLabels();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.baremetalsolution.v2.NetworkProto
.internal_static_google_cloud_baremetalsolution_v2_Network_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.baremetalsolution.v2.Network.class,
com.google.cloud.baremetalsolution.v2.Network.Builder.class);
}
// Construct using com.google.cloud.baremetalsolution.v2.Network.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
name_ = "";
id_ = "";
type_ = 0;
ipAddress_ = "";
macAddress_ = com.google.protobuf.LazyStringArrayList.emptyList();
state_ = 0;
vlanId_ = "";
cidr_ = "";
vrf_ = null;
if (vrfBuilder_ != null) {
vrfBuilder_.dispose();
vrfBuilder_ = null;
}
internalGetMutableLabels().clear();
servicesCidr_ = "";
if (reservationsBuilder_ == null) {
reservations_ = java.util.Collections.emptyList();
} else {
reservations_ = null;
reservationsBuilder_.clear();
}
bitField0_ = (bitField0_ & ~0x00000800);
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.baremetalsolution.v2.NetworkProto
.internal_static_google_cloud_baremetalsolution_v2_Network_descriptor;
}
@java.lang.Override
public com.google.cloud.baremetalsolution.v2.Network getDefaultInstanceForType() {
return com.google.cloud.baremetalsolution.v2.Network.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.baremetalsolution.v2.Network build() {
com.google.cloud.baremetalsolution.v2.Network result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.baremetalsolution.v2.Network buildPartial() {
com.google.cloud.baremetalsolution.v2.Network result =
new com.google.cloud.baremetalsolution.v2.Network(this);
buildPartialRepeatedFields(result);
if (bitField0_ != 0) {
buildPartial0(result);
}
onBuilt();
return result;
}
private void buildPartialRepeatedFields(com.google.cloud.baremetalsolution.v2.Network result) {
if (reservationsBuilder_ == null) {
if (((bitField0_ & 0x00000800) != 0)) {
reservations_ = java.util.Collections.unmodifiableList(reservations_);
bitField0_ = (bitField0_ & ~0x00000800);
}
result.reservations_ = reservations_;
} else {
result.reservations_ = reservationsBuilder_.build();
}
}
private void buildPartial0(com.google.cloud.baremetalsolution.v2.Network result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.name_ = name_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.id_ = id_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.type_ = type_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.ipAddress_ = ipAddress_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
macAddress_.makeImmutable();
result.macAddress_ = macAddress_;
}
if (((from_bitField0_ & 0x00000020) != 0)) {
result.state_ = state_;
}
if (((from_bitField0_ & 0x00000040) != 0)) {
result.vlanId_ = vlanId_;
}
if (((from_bitField0_ & 0x00000080) != 0)) {
result.cidr_ = cidr_;
}
if (((from_bitField0_ & 0x00000100) != 0)) {
result.vrf_ = vrfBuilder_ == null ? vrf_ : vrfBuilder_.build();
}
if (((from_bitField0_ & 0x00000200) != 0)) {
result.labels_ = internalGetLabels();
result.labels_.makeImmutable();
}
if (((from_bitField0_ & 0x00000400) != 0)) {
result.servicesCidr_ = servicesCidr_;
}
}
@java.lang.Override
public Builder clone() {
return super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.baremetalsolution.v2.Network) {
return mergeFrom((com.google.cloud.baremetalsolution.v2.Network) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.baremetalsolution.v2.Network other) {
if (other == com.google.cloud.baremetalsolution.v2.Network.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getId().isEmpty()) {
id_ = other.id_;
bitField0_ |= 0x00000002;
onChanged();
}
if (other.type_ != 0) {
setTypeValue(other.getTypeValue());
}
if (!other.getIpAddress().isEmpty()) {
ipAddress_ = other.ipAddress_;
bitField0_ |= 0x00000008;
onChanged();
}
if (!other.macAddress_.isEmpty()) {
if (macAddress_.isEmpty()) {
macAddress_ = other.macAddress_;
bitField0_ |= 0x00000010;
} else {
ensureMacAddressIsMutable();
macAddress_.addAll(other.macAddress_);
}
onChanged();
}
if (other.state_ != 0) {
setStateValue(other.getStateValue());
}
if (!other.getVlanId().isEmpty()) {
vlanId_ = other.vlanId_;
bitField0_ |= 0x00000040;
onChanged();
}
if (!other.getCidr().isEmpty()) {
cidr_ = other.cidr_;
bitField0_ |= 0x00000080;
onChanged();
}
if (other.hasVrf()) {
mergeVrf(other.getVrf());
}
internalGetMutableLabels().mergeFrom(other.internalGetLabels());
bitField0_ |= 0x00000200;
if (!other.getServicesCidr().isEmpty()) {
servicesCidr_ = other.servicesCidr_;
bitField0_ |= 0x00000400;
onChanged();
}
if (reservationsBuilder_ == null) {
if (!other.reservations_.isEmpty()) {
if (reservations_.isEmpty()) {
reservations_ = other.reservations_;
bitField0_ = (bitField0_ & ~0x00000800);
} else {
ensureReservationsIsMutable();
reservations_.addAll(other.reservations_);
}
onChanged();
}
} else {
if (!other.reservations_.isEmpty()) {
if (reservationsBuilder_.isEmpty()) {
reservationsBuilder_.dispose();
reservationsBuilder_ = null;
reservations_ = other.reservations_;
bitField0_ = (bitField0_ & ~0x00000800);
reservationsBuilder_ =
com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders
? getReservationsFieldBuilder()
: null;
} else {
reservationsBuilder_.addAllMessages(other.reservations_);
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 16:
{
type_ = input.readEnum();
bitField0_ |= 0x00000004;
break;
} // case 16
case 26:
{
ipAddress_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000008;
break;
} // case 26
case 34:
{
java.lang.String s = input.readStringRequireUtf8();
ensureMacAddressIsMutable();
macAddress_.add(s);
break;
} // case 34
case 42:
{
name_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 42
case 48:
{
state_ = input.readEnum();
bitField0_ |= 0x00000020;
break;
} // case 48
case 58:
{
vlanId_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000040;
break;
} // case 58
case 66:
{
cidr_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000080;
break;
} // case 66
case 74:
{
input.readMessage(getVrfFieldBuilder().getBuilder(), extensionRegistry);
bitField0_ |= 0x00000100;
break;
} // case 74
case 82:
{
id_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 82
case 90:
{
com.google.protobuf.MapEntry labels__ =
input.readMessage(
LabelsDefaultEntryHolder.defaultEntry.getParserForType(),
extensionRegistry);
internalGetMutableLabels()
.getMutableMap()
.put(labels__.getKey(), labels__.getValue());
bitField0_ |= 0x00000200;
break;
} // case 90
case 98:
{
servicesCidr_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000400;
break;
} // case 98
case 106:
{
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation m =
input.readMessage(
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation.parser(),
extensionRegistry);
if (reservationsBuilder_ == null) {
ensureReservationsIsMutable();
reservations_.add(m);
} else {
reservationsBuilder_.addMessage(m);
}
break;
} // case 106
default:
{
if (!super.parseUnknownField(input, extensionRegistry, tag)) {
done = true; // was an endgroup tag
}
break;
} // default:
} // switch (tag)
} // while (!done)
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.unwrapIOException();
} finally {
onChanged();
} // finally
return this;
}
private int bitField0_;
private java.lang.Object name_ = "";
/**
*
*
*
* Output only. The resource name of this `Network`.
* Resource names are schemeless URIs that follow the conventions in
* https://cloud.google.com/apis/design/resource_names.
* Format:
* `projects/{project}/locations/{location}/networks/{network}`
*
*
* string name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return The name.
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Output only. The resource name of this `Network`.
* Resource names are schemeless URIs that follow the conventions in
* https://cloud.google.com/apis/design/resource_names.
* Format:
* `projects/{project}/locations/{location}/networks/{network}`
*
*
* string name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return The bytes for name.
*/
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Output only. The resource name of this `Network`.
* Resource names are schemeless URIs that follow the conventions in
* https://cloud.google.com/apis/design/resource_names.
* Format:
* `projects/{project}/locations/{location}/networks/{network}`
*
*
* string name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @param value The name to set.
* @return This builder for chaining.
*/
public Builder setName(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* Output only. The resource name of this `Network`.
* Resource names are schemeless URIs that follow the conventions in
* https://cloud.google.com/apis/design/resource_names.
* Format:
* `projects/{project}/locations/{location}/networks/{network}`
*
*
* string name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @return This builder for chaining.
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* Output only. The resource name of this `Network`.
* Resource names are schemeless URIs that follow the conventions in
* https://cloud.google.com/apis/design/resource_names.
* Format:
* `projects/{project}/locations/{location}/networks/{network}`
*
*
* string name = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];
*
* @param value The bytes for name to set.
* @return This builder for chaining.
*/
public Builder setNameBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
bitField0_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object id_ = "";
/**
*
*
*
* An identifier for the `Network`, generated by the backend.
*
*
* string id = 10;
*
* @return The id.
*/
public java.lang.String getId() {
java.lang.Object ref = id_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
id_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* An identifier for the `Network`, generated by the backend.
*
*
* string id = 10;
*
* @return The bytes for id.
*/
public com.google.protobuf.ByteString getIdBytes() {
java.lang.Object ref = id_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
id_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* An identifier for the `Network`, generated by the backend.
*
*
* string id = 10;
*
* @param value The id to set.
* @return This builder for chaining.
*/
public Builder setId(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
id_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* An identifier for the `Network`, generated by the backend.
*
*
* string id = 10;
*
* @return This builder for chaining.
*/
public Builder clearId() {
id_ = getDefaultInstance().getId();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
*
*
* An identifier for the `Network`, generated by the backend.
*
*
* string id = 10;
*
* @param value The bytes for id to set.
* @return This builder for chaining.
*/
public Builder setIdBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
id_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private int type_ = 0;
/**
*
*
*
* The type of this network.
*
*
* .google.cloud.baremetalsolution.v2.Network.Type type = 2;
*
* @return The enum numeric value on the wire for type.
*/
@java.lang.Override
public int getTypeValue() {
return type_;
}
/**
*
*
*
* The type of this network.
*
*
* .google.cloud.baremetalsolution.v2.Network.Type type = 2;
*
* @param value The enum numeric value on the wire for type to set.
* @return This builder for chaining.
*/
public Builder setTypeValue(int value) {
type_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* The type of this network.
*
*
* .google.cloud.baremetalsolution.v2.Network.Type type = 2;
*
* @return The type.
*/
@java.lang.Override
public com.google.cloud.baremetalsolution.v2.Network.Type getType() {
com.google.cloud.baremetalsolution.v2.Network.Type result =
com.google.cloud.baremetalsolution.v2.Network.Type.forNumber(type_);
return result == null
? com.google.cloud.baremetalsolution.v2.Network.Type.UNRECOGNIZED
: result;
}
/**
*
*
*
* The type of this network.
*
*
* .google.cloud.baremetalsolution.v2.Network.Type type = 2;
*
* @param value The type to set.
* @return This builder for chaining.
*/
public Builder setType(com.google.cloud.baremetalsolution.v2.Network.Type value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000004;
type_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
*
* The type of this network.
*
*
* .google.cloud.baremetalsolution.v2.Network.Type type = 2;
*
* @return This builder for chaining.
*/
public Builder clearType() {
bitField0_ = (bitField0_ & ~0x00000004);
type_ = 0;
onChanged();
return this;
}
private java.lang.Object ipAddress_ = "";
/**
*
*
*
* IP address configured.
*
*
* string ip_address = 3;
*
* @return The ipAddress.
*/
public java.lang.String getIpAddress() {
java.lang.Object ref = ipAddress_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
ipAddress_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* IP address configured.
*
*
* string ip_address = 3;
*
* @return The bytes for ipAddress.
*/
public com.google.protobuf.ByteString getIpAddressBytes() {
java.lang.Object ref = ipAddress_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
ipAddress_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* IP address configured.
*
*
* string ip_address = 3;
*
* @param value The ipAddress to set.
* @return This builder for chaining.
*/
public Builder setIpAddress(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ipAddress_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
*
* IP address configured.
*
*
* string ip_address = 3;
*
* @return This builder for chaining.
*/
public Builder clearIpAddress() {
ipAddress_ = getDefaultInstance().getIpAddress();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
/**
*
*
*
* IP address configured.
*
*
* string ip_address = 3;
*
* @param value The bytes for ipAddress to set.
* @return This builder for chaining.
*/
public Builder setIpAddressBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ipAddress_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
private com.google.protobuf.LazyStringArrayList macAddress_ =
com.google.protobuf.LazyStringArrayList.emptyList();
private void ensureMacAddressIsMutable() {
if (!macAddress_.isModifiable()) {
macAddress_ = new com.google.protobuf.LazyStringArrayList(macAddress_);
}
bitField0_ |= 0x00000010;
}
/**
*
*
*
* List of physical interfaces.
*
*
* repeated string mac_address = 4;
*
* @return A list containing the macAddress.
*/
public com.google.protobuf.ProtocolStringList getMacAddressList() {
macAddress_.makeImmutable();
return macAddress_;
}
/**
*
*
*
* List of physical interfaces.
*
*
* repeated string mac_address = 4;
*
* @return The count of macAddress.
*/
public int getMacAddressCount() {
return macAddress_.size();
}
/**
*
*
*
* List of physical interfaces.
*
*
* repeated string mac_address = 4;
*
* @param index The index of the element to return.
* @return The macAddress at the given index.
*/
public java.lang.String getMacAddress(int index) {
return macAddress_.get(index);
}
/**
*
*
*
* List of physical interfaces.
*
*
* repeated string mac_address = 4;
*
* @param index The index of the value to return.
* @return The bytes of the macAddress at the given index.
*/
public com.google.protobuf.ByteString getMacAddressBytes(int index) {
return macAddress_.getByteString(index);
}
/**
*
*
*
* List of physical interfaces.
*
*
* repeated string mac_address = 4;
*
* @param index The index to set the value at.
* @param value The macAddress to set.
* @return This builder for chaining.
*/
public Builder setMacAddress(int index, java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureMacAddressIsMutable();
macAddress_.set(index, value);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* List of physical interfaces.
*
*
* repeated string mac_address = 4;
*
* @param value The macAddress to add.
* @return This builder for chaining.
*/
public Builder addMacAddress(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
ensureMacAddressIsMutable();
macAddress_.add(value);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* List of physical interfaces.
*
*
* repeated string mac_address = 4;
*
* @param values The macAddress to add.
* @return This builder for chaining.
*/
public Builder addAllMacAddress(java.lang.Iterable values) {
ensureMacAddressIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, macAddress_);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
/**
*
*
*
* List of physical interfaces.
*
*
* repeated string mac_address = 4;
*
* @return This builder for chaining.
*/
public Builder clearMacAddress() {
macAddress_ = com.google.protobuf.LazyStringArrayList.emptyList();
bitField0_ = (bitField0_ & ~0x00000010);
;
onChanged();
return this;
}
/**
*
*
*
* List of physical interfaces.
*
*
* repeated string mac_address = 4;
*
* @param value The bytes of the macAddress to add.
* @return This builder for chaining.
*/
public Builder addMacAddressBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
ensureMacAddressIsMutable();
macAddress_.add(value);
bitField0_ |= 0x00000010;
onChanged();
return this;
}
private int state_ = 0;
/**
*
*
*
* The Network state.
*
*
* .google.cloud.baremetalsolution.v2.Network.State state = 6;
*
* @return The enum numeric value on the wire for state.
*/
@java.lang.Override
public int getStateValue() {
return state_;
}
/**
*
*
*
* The Network state.
*
*
* .google.cloud.baremetalsolution.v2.Network.State state = 6;
*
* @param value The enum numeric value on the wire for state to set.
* @return This builder for chaining.
*/
public Builder setStateValue(int value) {
state_ = value;
bitField0_ |= 0x00000020;
onChanged();
return this;
}
/**
*
*
*
* The Network state.
*
*
* .google.cloud.baremetalsolution.v2.Network.State state = 6;
*
* @return The state.
*/
@java.lang.Override
public com.google.cloud.baremetalsolution.v2.Network.State getState() {
com.google.cloud.baremetalsolution.v2.Network.State result =
com.google.cloud.baremetalsolution.v2.Network.State.forNumber(state_);
return result == null
? com.google.cloud.baremetalsolution.v2.Network.State.UNRECOGNIZED
: result;
}
/**
*
*
*
* The Network state.
*
*
* .google.cloud.baremetalsolution.v2.Network.State state = 6;
*
* @param value The state to set.
* @return This builder for chaining.
*/
public Builder setState(com.google.cloud.baremetalsolution.v2.Network.State value) {
if (value == null) {
throw new NullPointerException();
}
bitField0_ |= 0x00000020;
state_ = value.getNumber();
onChanged();
return this;
}
/**
*
*
*
* The Network state.
*
*
* .google.cloud.baremetalsolution.v2.Network.State state = 6;
*
* @return This builder for chaining.
*/
public Builder clearState() {
bitField0_ = (bitField0_ & ~0x00000020);
state_ = 0;
onChanged();
return this;
}
private java.lang.Object vlanId_ = "";
/**
*
*
*
* The vlan id of the Network.
*
*
* string vlan_id = 7;
*
* @return The vlanId.
*/
public java.lang.String getVlanId() {
java.lang.Object ref = vlanId_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
vlanId_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* The vlan id of the Network.
*
*
* string vlan_id = 7;
*
* @return The bytes for vlanId.
*/
public com.google.protobuf.ByteString getVlanIdBytes() {
java.lang.Object ref = vlanId_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
vlanId_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The vlan id of the Network.
*
*
* string vlan_id = 7;
*
* @param value The vlanId to set.
* @return This builder for chaining.
*/
public Builder setVlanId(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
vlanId_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
/**
*
*
*
* The vlan id of the Network.
*
*
* string vlan_id = 7;
*
* @return This builder for chaining.
*/
public Builder clearVlanId() {
vlanId_ = getDefaultInstance().getVlanId();
bitField0_ = (bitField0_ & ~0x00000040);
onChanged();
return this;
}
/**
*
*
*
* The vlan id of the Network.
*
*
* string vlan_id = 7;
*
* @param value The bytes for vlanId to set.
* @return This builder for chaining.
*/
public Builder setVlanIdBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
vlanId_ = value;
bitField0_ |= 0x00000040;
onChanged();
return this;
}
private java.lang.Object cidr_ = "";
/**
*
*
*
* The cidr of the Network.
*
*
* string cidr = 8;
*
* @return The cidr.
*/
public java.lang.String getCidr() {
java.lang.Object ref = cidr_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
cidr_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* The cidr of the Network.
*
*
* string cidr = 8;
*
* @return The bytes for cidr.
*/
public com.google.protobuf.ByteString getCidrBytes() {
java.lang.Object ref = cidr_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
cidr_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* The cidr of the Network.
*
*
* string cidr = 8;
*
* @param value The cidr to set.
* @return This builder for chaining.
*/
public Builder setCidr(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
cidr_ = value;
bitField0_ |= 0x00000080;
onChanged();
return this;
}
/**
*
*
*
* The cidr of the Network.
*
*
* string cidr = 8;
*
* @return This builder for chaining.
*/
public Builder clearCidr() {
cidr_ = getDefaultInstance().getCidr();
bitField0_ = (bitField0_ & ~0x00000080);
onChanged();
return this;
}
/**
*
*
*
* The cidr of the Network.
*
*
* string cidr = 8;
*
* @param value The bytes for cidr to set.
* @return This builder for chaining.
*/
public Builder setCidrBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
cidr_ = value;
bitField0_ |= 0x00000080;
onChanged();
return this;
}
private com.google.cloud.baremetalsolution.v2.VRF vrf_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.baremetalsolution.v2.VRF,
com.google.cloud.baremetalsolution.v2.VRF.Builder,
com.google.cloud.baremetalsolution.v2.VRFOrBuilder>
vrfBuilder_;
/**
*
*
*
* The vrf for the Network.
*
*
* .google.cloud.baremetalsolution.v2.VRF vrf = 9;
*
* @return Whether the vrf field is set.
*/
public boolean hasVrf() {
return ((bitField0_ & 0x00000100) != 0);
}
/**
*
*
*
* The vrf for the Network.
*
*
* .google.cloud.baremetalsolution.v2.VRF vrf = 9;
*
* @return The vrf.
*/
public com.google.cloud.baremetalsolution.v2.VRF getVrf() {
if (vrfBuilder_ == null) {
return vrf_ == null ? com.google.cloud.baremetalsolution.v2.VRF.getDefaultInstance() : vrf_;
} else {
return vrfBuilder_.getMessage();
}
}
/**
*
*
*
* The vrf for the Network.
*
*
* .google.cloud.baremetalsolution.v2.VRF vrf = 9;
*/
public Builder setVrf(com.google.cloud.baremetalsolution.v2.VRF value) {
if (vrfBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
vrf_ = value;
} else {
vrfBuilder_.setMessage(value);
}
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
*
*
* The vrf for the Network.
*
*
* .google.cloud.baremetalsolution.v2.VRF vrf = 9;
*/
public Builder setVrf(com.google.cloud.baremetalsolution.v2.VRF.Builder builderForValue) {
if (vrfBuilder_ == null) {
vrf_ = builderForValue.build();
} else {
vrfBuilder_.setMessage(builderForValue.build());
}
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
*
*
* The vrf for the Network.
*
*
* .google.cloud.baremetalsolution.v2.VRF vrf = 9;
*/
public Builder mergeVrf(com.google.cloud.baremetalsolution.v2.VRF value) {
if (vrfBuilder_ == null) {
if (((bitField0_ & 0x00000100) != 0)
&& vrf_ != null
&& vrf_ != com.google.cloud.baremetalsolution.v2.VRF.getDefaultInstance()) {
getVrfBuilder().mergeFrom(value);
} else {
vrf_ = value;
}
} else {
vrfBuilder_.mergeFrom(value);
}
bitField0_ |= 0x00000100;
onChanged();
return this;
}
/**
*
*
*
* The vrf for the Network.
*
*
* .google.cloud.baremetalsolution.v2.VRF vrf = 9;
*/
public Builder clearVrf() {
bitField0_ = (bitField0_ & ~0x00000100);
vrf_ = null;
if (vrfBuilder_ != null) {
vrfBuilder_.dispose();
vrfBuilder_ = null;
}
onChanged();
return this;
}
/**
*
*
*
* The vrf for the Network.
*
*
* .google.cloud.baremetalsolution.v2.VRF vrf = 9;
*/
public com.google.cloud.baremetalsolution.v2.VRF.Builder getVrfBuilder() {
bitField0_ |= 0x00000100;
onChanged();
return getVrfFieldBuilder().getBuilder();
}
/**
*
*
*
* The vrf for the Network.
*
*
* .google.cloud.baremetalsolution.v2.VRF vrf = 9;
*/
public com.google.cloud.baremetalsolution.v2.VRFOrBuilder getVrfOrBuilder() {
if (vrfBuilder_ != null) {
return vrfBuilder_.getMessageOrBuilder();
} else {
return vrf_ == null ? com.google.cloud.baremetalsolution.v2.VRF.getDefaultInstance() : vrf_;
}
}
/**
*
*
*
* The vrf for the Network.
*
*
* .google.cloud.baremetalsolution.v2.VRF vrf = 9;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.baremetalsolution.v2.VRF,
com.google.cloud.baremetalsolution.v2.VRF.Builder,
com.google.cloud.baremetalsolution.v2.VRFOrBuilder>
getVrfFieldBuilder() {
if (vrfBuilder_ == null) {
vrfBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.cloud.baremetalsolution.v2.VRF,
com.google.cloud.baremetalsolution.v2.VRF.Builder,
com.google.cloud.baremetalsolution.v2.VRFOrBuilder>(
getVrf(), getParentForChildren(), isClean());
vrf_ = null;
}
return vrfBuilder_;
}
private com.google.protobuf.MapField labels_;
private com.google.protobuf.MapField internalGetLabels() {
if (labels_ == null) {
return com.google.protobuf.MapField.emptyMapField(LabelsDefaultEntryHolder.defaultEntry);
}
return labels_;
}
private com.google.protobuf.MapField
internalGetMutableLabels() {
if (labels_ == null) {
labels_ = com.google.protobuf.MapField.newMapField(LabelsDefaultEntryHolder.defaultEntry);
}
if (!labels_.isMutable()) {
labels_ = labels_.copy();
}
bitField0_ |= 0x00000200;
onChanged();
return labels_;
}
public int getLabelsCount() {
return internalGetLabels().getMap().size();
}
/**
*
*
*
* Labels as key value pairs.
*
*
* map<string, string> labels = 11;
*/
@java.lang.Override
public boolean containsLabels(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetLabels().getMap().containsKey(key);
}
/** Use {@link #getLabelsMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map getLabels() {
return getLabelsMap();
}
/**
*
*
*
* Labels as key value pairs.
*
*
* map<string, string> labels = 11;
*/
@java.lang.Override
public java.util.Map getLabelsMap() {
return internalGetLabels().getMap();
}
/**
*
*
*
* Labels as key value pairs.
*
*
* map<string, string> labels = 11;
*/
@java.lang.Override
public /* nullable */ java.lang.String getLabelsOrDefault(
java.lang.String key,
/* nullable */
java.lang.String defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetLabels().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
*
*
* Labels as key value pairs.
*
*
* map<string, string> labels = 11;
*/
@java.lang.Override
public java.lang.String getLabelsOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map map = internalGetLabels().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public Builder clearLabels() {
bitField0_ = (bitField0_ & ~0x00000200);
internalGetMutableLabels().getMutableMap().clear();
return this;
}
/**
*
*
*
* Labels as key value pairs.
*
*
* map<string, string> labels = 11;
*/
public Builder removeLabels(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
internalGetMutableLabels().getMutableMap().remove(key);
return this;
}
/** Use alternate mutation accessors instead. */
@java.lang.Deprecated
public java.util.Map getMutableLabels() {
bitField0_ |= 0x00000200;
return internalGetMutableLabels().getMutableMap();
}
/**
*
*
*
* Labels as key value pairs.
*
*
* map<string, string> labels = 11;
*/
public Builder putLabels(java.lang.String key, java.lang.String value) {
if (key == null) {
throw new NullPointerException("map key");
}
if (value == null) {
throw new NullPointerException("map value");
}
internalGetMutableLabels().getMutableMap().put(key, value);
bitField0_ |= 0x00000200;
return this;
}
/**
*
*
*
* Labels as key value pairs.
*
*
* map<string, string> labels = 11;
*/
public Builder putAllLabels(java.util.Map values) {
internalGetMutableLabels().getMutableMap().putAll(values);
bitField0_ |= 0x00000200;
return this;
}
private java.lang.Object servicesCidr_ = "";
/**
*
*
*
* IP range for reserved for services (e.g. NFS).
*
*
* string services_cidr = 12;
*
* @return The servicesCidr.
*/
public java.lang.String getServicesCidr() {
java.lang.Object ref = servicesCidr_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
servicesCidr_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* IP range for reserved for services (e.g. NFS).
*
*
* string services_cidr = 12;
*
* @return The bytes for servicesCidr.
*/
public com.google.protobuf.ByteString getServicesCidrBytes() {
java.lang.Object ref = servicesCidr_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
servicesCidr_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* IP range for reserved for services (e.g. NFS).
*
*
* string services_cidr = 12;
*
* @param value The servicesCidr to set.
* @return This builder for chaining.
*/
public Builder setServicesCidr(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
servicesCidr_ = value;
bitField0_ |= 0x00000400;
onChanged();
return this;
}
/**
*
*
*
* IP range for reserved for services (e.g. NFS).
*
*
* string services_cidr = 12;
*
* @return This builder for chaining.
*/
public Builder clearServicesCidr() {
servicesCidr_ = getDefaultInstance().getServicesCidr();
bitField0_ = (bitField0_ & ~0x00000400);
onChanged();
return this;
}
/**
*
*
*
* IP range for reserved for services (e.g. NFS).
*
*
* string services_cidr = 12;
*
* @param value The bytes for servicesCidr to set.
* @return This builder for chaining.
*/
public Builder setServicesCidrBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
servicesCidr_ = value;
bitField0_ |= 0x00000400;
onChanged();
return this;
}
private java.util.List
reservations_ = java.util.Collections.emptyList();
private void ensureReservationsIsMutable() {
if (!((bitField0_ & 0x00000800) != 0)) {
reservations_ =
new java.util.ArrayList<
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation>(reservations_);
bitField0_ |= 0x00000800;
}
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation,
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation.Builder,
com.google.cloud.baremetalsolution.v2.NetworkAddressReservationOrBuilder>
reservationsBuilder_;
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public java.util.List
getReservationsList() {
if (reservationsBuilder_ == null) {
return java.util.Collections.unmodifiableList(reservations_);
} else {
return reservationsBuilder_.getMessageList();
}
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public int getReservationsCount() {
if (reservationsBuilder_ == null) {
return reservations_.size();
} else {
return reservationsBuilder_.getCount();
}
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public com.google.cloud.baremetalsolution.v2.NetworkAddressReservation getReservations(
int index) {
if (reservationsBuilder_ == null) {
return reservations_.get(index);
} else {
return reservationsBuilder_.getMessage(index);
}
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public Builder setReservations(
int index, com.google.cloud.baremetalsolution.v2.NetworkAddressReservation value) {
if (reservationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureReservationsIsMutable();
reservations_.set(index, value);
onChanged();
} else {
reservationsBuilder_.setMessage(index, value);
}
return this;
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public Builder setReservations(
int index,
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation.Builder builderForValue) {
if (reservationsBuilder_ == null) {
ensureReservationsIsMutable();
reservations_.set(index, builderForValue.build());
onChanged();
} else {
reservationsBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public Builder addReservations(
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation value) {
if (reservationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureReservationsIsMutable();
reservations_.add(value);
onChanged();
} else {
reservationsBuilder_.addMessage(value);
}
return this;
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public Builder addReservations(
int index, com.google.cloud.baremetalsolution.v2.NetworkAddressReservation value) {
if (reservationsBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureReservationsIsMutable();
reservations_.add(index, value);
onChanged();
} else {
reservationsBuilder_.addMessage(index, value);
}
return this;
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public Builder addReservations(
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation.Builder builderForValue) {
if (reservationsBuilder_ == null) {
ensureReservationsIsMutable();
reservations_.add(builderForValue.build());
onChanged();
} else {
reservationsBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public Builder addReservations(
int index,
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation.Builder builderForValue) {
if (reservationsBuilder_ == null) {
ensureReservationsIsMutable();
reservations_.add(index, builderForValue.build());
onChanged();
} else {
reservationsBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public Builder addAllReservations(
java.lang.Iterable<
? extends com.google.cloud.baremetalsolution.v2.NetworkAddressReservation>
values) {
if (reservationsBuilder_ == null) {
ensureReservationsIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(values, reservations_);
onChanged();
} else {
reservationsBuilder_.addAllMessages(values);
}
return this;
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public Builder clearReservations() {
if (reservationsBuilder_ == null) {
reservations_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000800);
onChanged();
} else {
reservationsBuilder_.clear();
}
return this;
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public Builder removeReservations(int index) {
if (reservationsBuilder_ == null) {
ensureReservationsIsMutable();
reservations_.remove(index);
onChanged();
} else {
reservationsBuilder_.remove(index);
}
return this;
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public com.google.cloud.baremetalsolution.v2.NetworkAddressReservation.Builder
getReservationsBuilder(int index) {
return getReservationsFieldBuilder().getBuilder(index);
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public com.google.cloud.baremetalsolution.v2.NetworkAddressReservationOrBuilder
getReservationsOrBuilder(int index) {
if (reservationsBuilder_ == null) {
return reservations_.get(index);
} else {
return reservationsBuilder_.getMessageOrBuilder(index);
}
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public java.util.List<
? extends com.google.cloud.baremetalsolution.v2.NetworkAddressReservationOrBuilder>
getReservationsOrBuilderList() {
if (reservationsBuilder_ != null) {
return reservationsBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(reservations_);
}
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public com.google.cloud.baremetalsolution.v2.NetworkAddressReservation.Builder
addReservationsBuilder() {
return getReservationsFieldBuilder()
.addBuilder(
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation.getDefaultInstance());
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public com.google.cloud.baremetalsolution.v2.NetworkAddressReservation.Builder
addReservationsBuilder(int index) {
return getReservationsFieldBuilder()
.addBuilder(
index,
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation.getDefaultInstance());
}
/**
*
*
*
* List of IP address reservations in this network.
* When updating this field, an error will be generated if a reservation
* conflicts with an IP address already allocated to a physical server.
*
*
*
* repeated .google.cloud.baremetalsolution.v2.NetworkAddressReservation reservations = 13;
*
*/
public java.util.List
getReservationsBuilderList() {
return getReservationsFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation,
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation.Builder,
com.google.cloud.baremetalsolution.v2.NetworkAddressReservationOrBuilder>
getReservationsFieldBuilder() {
if (reservationsBuilder_ == null) {
reservationsBuilder_ =
new com.google.protobuf.RepeatedFieldBuilderV3<
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation,
com.google.cloud.baremetalsolution.v2.NetworkAddressReservation.Builder,
com.google.cloud.baremetalsolution.v2.NetworkAddressReservationOrBuilder>(
reservations_, ((bitField0_ & 0x00000800) != 0), getParentForChildren(), isClean());
reservations_ = null;
}
return reservationsBuilder_;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFields(unknownFields);
}
@java.lang.Override
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:google.cloud.baremetalsolution.v2.Network)
}
// @@protoc_insertion_point(class_scope:google.cloud.baremetalsolution.v2.Network)
private static final com.google.cloud.baremetalsolution.v2.Network DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.baremetalsolution.v2.Network();
}
public static com.google.cloud.baremetalsolution.v2.Network getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public Network parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
Builder builder = newBuilder();
try {
builder.mergeFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(builder.buildPartial());
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(e)
.setUnfinishedMessage(builder.buildPartial());
}
return builder.buildPartial();
}
};
public static com.google.protobuf.Parser parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.baremetalsolution.v2.Network getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}