blob: 235bb3366a83e70aefce26e4c4013cb47efa78a6 [file] [log] [blame]
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: grpc/gcp/handshaker.proto
package io.grpc.alts.internal;
/**
* Protobuf type {@code grpc.gcp.Identity}
*/
public final class Identity extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:grpc.gcp.Identity)
IdentityOrBuilder {
private static final long serialVersionUID = 0L;
// Use Identity.newBuilder() to construct.
private Identity(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private Identity() {
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private Identity(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!parseUnknownFieldProto3(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
case 10: {
java.lang.String s = input.readStringRequireUtf8();
identityOneofCase_ = 1;
identityOneof_ = s;
break;
}
case 18: {
java.lang.String s = input.readStringRequireUtf8();
identityOneofCase_ = 2;
identityOneof_ = s;
break;
}
case 26: {
if (!((mutable_bitField0_ & 0x00000004) == 0x00000004)) {
attributes_ = com.google.protobuf.MapField.newMapField(
AttributesDefaultEntryHolder.defaultEntry);
mutable_bitField0_ |= 0x00000004;
}
com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
attributes__ = input.readMessage(
AttributesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
attributes_.getMutableMap().put(
attributes__.getKey(), attributes__.getValue());
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.alts.internal.HandshakerProto.internal_static_grpc_gcp_Identity_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMapField(
int number) {
switch (number) {
case 3:
return internalGetAttributes();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.alts.internal.HandshakerProto.internal_static_grpc_gcp_Identity_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.alts.internal.Identity.class, io.grpc.alts.internal.Identity.Builder.class);
}
private int bitField0_;
private int identityOneofCase_ = 0;
private java.lang.Object identityOneof_;
public enum IdentityOneofCase
implements com.google.protobuf.Internal.EnumLite {
SERVICE_ACCOUNT(1),
HOSTNAME(2),
IDENTITYONEOF_NOT_SET(0);
private final int value;
private IdentityOneofCase(int value) {
this.value = value;
}
/**
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static IdentityOneofCase valueOf(int value) {
return forNumber(value);
}
public static IdentityOneofCase forNumber(int value) {
switch (value) {
case 1: return SERVICE_ACCOUNT;
case 2: return HOSTNAME;
case 0: return IDENTITYONEOF_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public IdentityOneofCase
getIdentityOneofCase() {
return IdentityOneofCase.forNumber(
identityOneofCase_);
}
public static final int SERVICE_ACCOUNT_FIELD_NUMBER = 1;
/**
* <pre>
* Service account of a connection endpoint.
* </pre>
*
* <code>string service_account = 1;</code>
*/
public java.lang.String getServiceAccount() {
java.lang.Object ref = "";
if (identityOneofCase_ == 1) {
ref = identityOneof_;
}
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();
if (identityOneofCase_ == 1) {
identityOneof_ = s;
}
return s;
}
}
/**
* <pre>
* Service account of a connection endpoint.
* </pre>
*
* <code>string service_account = 1;</code>
*/
public com.google.protobuf.ByteString
getServiceAccountBytes() {
java.lang.Object ref = "";
if (identityOneofCase_ == 1) {
ref = identityOneof_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (identityOneofCase_ == 1) {
identityOneof_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int HOSTNAME_FIELD_NUMBER = 2;
/**
* <pre>
* Hostname of a connection endpoint.
* </pre>
*
* <code>string hostname = 2;</code>
*/
public java.lang.String getHostname() {
java.lang.Object ref = "";
if (identityOneofCase_ == 2) {
ref = identityOneof_;
}
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();
if (identityOneofCase_ == 2) {
identityOneof_ = s;
}
return s;
}
}
/**
* <pre>
* Hostname of a connection endpoint.
* </pre>
*
* <code>string hostname = 2;</code>
*/
public com.google.protobuf.ByteString
getHostnameBytes() {
java.lang.Object ref = "";
if (identityOneofCase_ == 2) {
ref = identityOneof_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (identityOneofCase_ == 2) {
identityOneof_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ATTRIBUTES_FIELD_NUMBER = 3;
private static final class AttributesDefaultEntryHolder {
static final com.google.protobuf.MapEntry<
java.lang.String, java.lang.String> defaultEntry =
com.google.protobuf.MapEntry
.<java.lang.String, java.lang.String>newDefaultInstance(
io.grpc.alts.internal.HandshakerProto.internal_static_grpc_gcp_Identity_AttributesEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.STRING,
"");
}
private com.google.protobuf.MapField<
java.lang.String, java.lang.String> attributes_;
private com.google.protobuf.MapField<java.lang.String, java.lang.String>
internalGetAttributes() {
if (attributes_ == null) {
return com.google.protobuf.MapField.emptyMapField(
AttributesDefaultEntryHolder.defaultEntry);
}
return attributes_;
}
public int getAttributesCount() {
return internalGetAttributes().getMap().size();
}
/**
* <pre>
* Additional attributes of the identity.
* </pre>
*
* <code>map&lt;string, string&gt; attributes = 3;</code>
*/
public boolean containsAttributes(
java.lang.String key) {
if (key == null) { throw new java.lang.NullPointerException(); }
return internalGetAttributes().getMap().containsKey(key);
}
/**
* Use {@link #getAttributesMap()} instead.
*/
@java.lang.Deprecated
public java.util.Map<java.lang.String, java.lang.String> getAttributes() {
return getAttributesMap();
}
/**
* <pre>
* Additional attributes of the identity.
* </pre>
*
* <code>map&lt;string, string&gt; attributes = 3;</code>
*/
public java.util.Map<java.lang.String, java.lang.String> getAttributesMap() {
return internalGetAttributes().getMap();
}
/**
* <pre>
* Additional attributes of the identity.
* </pre>
*
* <code>map&lt;string, string&gt; attributes = 3;</code>
*/
public java.lang.String getAttributesOrDefault(
java.lang.String key,
java.lang.String defaultValue) {
if (key == null) { throw new java.lang.NullPointerException(); }
java.util.Map<java.lang.String, java.lang.String> map =
internalGetAttributes().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
* <pre>
* Additional attributes of the identity.
* </pre>
*
* <code>map&lt;string, string&gt; attributes = 3;</code>
*/
public java.lang.String getAttributesOrThrow(
java.lang.String key) {
if (key == null) { throw new java.lang.NullPointerException(); }
java.util.Map<java.lang.String, java.lang.String> map =
internalGetAttributes().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (identityOneofCase_ == 1) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, identityOneof_);
}
if (identityOneofCase_ == 2) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, identityOneof_);
}
com.google.protobuf.GeneratedMessageV3
.serializeStringMapTo(
output,
internalGetAttributes(),
AttributesDefaultEntryHolder.defaultEntry,
3);
unknownFields.writeTo(output);
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (identityOneofCase_ == 1) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, identityOneof_);
}
if (identityOneofCase_ == 2) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, identityOneof_);
}
for (java.util.Map.Entry<java.lang.String, java.lang.String> entry
: internalGetAttributes().getMap().entrySet()) {
com.google.protobuf.MapEntry<java.lang.String, java.lang.String>
attributes__ = AttributesDefaultEntryHolder.defaultEntry.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(3, attributes__);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof io.grpc.alts.internal.Identity)) {
return super.equals(obj);
}
io.grpc.alts.internal.Identity other = (io.grpc.alts.internal.Identity) obj;
boolean result = true;
result = result && internalGetAttributes().equals(
other.internalGetAttributes());
result = result && getIdentityOneofCase().equals(
other.getIdentityOneofCase());
if (!result) return false;
switch (identityOneofCase_) {
case 1:
result = result && getServiceAccount()
.equals(other.getServiceAccount());
break;
case 2:
result = result && getHostname()
.equals(other.getHostname());
break;
case 0:
default:
}
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();
if (!internalGetAttributes().getMap().isEmpty()) {
hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER;
hash = (53 * hash) + internalGetAttributes().hashCode();
}
switch (identityOneofCase_) {
case 1:
hash = (37 * hash) + SERVICE_ACCOUNT_FIELD_NUMBER;
hash = (53 * hash) + getServiceAccount().hashCode();
break;
case 2:
hash = (37 * hash) + HOSTNAME_FIELD_NUMBER;
hash = (53 * hash) + getHostname().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static io.grpc.alts.internal.Identity parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.alts.internal.Identity parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.alts.internal.Identity parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.alts.internal.Identity parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.alts.internal.Identity parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.alts.internal.Identity parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.alts.internal.Identity parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.alts.internal.Identity 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 io.grpc.alts.internal.Identity parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.alts.internal.Identity 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 io.grpc.alts.internal.Identity parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static io.grpc.alts.internal.Identity parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.alts.internal.Identity prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
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;
}
/**
* Protobuf type {@code grpc.gcp.Identity}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:grpc.gcp.Identity)
io.grpc.alts.internal.IdentityOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.alts.internal.HandshakerProto.internal_static_grpc_gcp_Identity_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMapField(
int number) {
switch (number) {
case 3:
return internalGetAttributes();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapField internalGetMutableMapField(
int number) {
switch (number) {
case 3:
return internalGetMutableAttributes();
default:
throw new RuntimeException(
"Invalid map field number: " + number);
}
}
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.alts.internal.HandshakerProto.internal_static_grpc_gcp_Identity_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.alts.internal.Identity.class, io.grpc.alts.internal.Identity.Builder.class);
}
// Construct using io.grpc.alts.internal.Identity.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
internalGetMutableAttributes().clear();
identityOneofCase_ = 0;
identityOneof_ = null;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.alts.internal.HandshakerProto.internal_static_grpc_gcp_Identity_descriptor;
}
public io.grpc.alts.internal.Identity getDefaultInstanceForType() {
return io.grpc.alts.internal.Identity.getDefaultInstance();
}
public io.grpc.alts.internal.Identity build() {
io.grpc.alts.internal.Identity result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.alts.internal.Identity buildPartial() {
io.grpc.alts.internal.Identity result = new io.grpc.alts.internal.Identity(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (identityOneofCase_ == 1) {
result.identityOneof_ = identityOneof_;
}
if (identityOneofCase_ == 2) {
result.identityOneof_ = identityOneof_;
}
result.attributes_ = internalGetAttributes();
result.attributes_.makeImmutable();
result.bitField0_ = to_bitField0_;
result.identityOneofCase_ = identityOneofCase_;
onBuilt();
return result;
}
public Builder clone() {
return (Builder) super.clone();
}
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.setField(field, value);
}
public Builder clearField(
com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
public Builder clearOneof(
com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
int index, java.lang.Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field,
java.lang.Object value) {
return (Builder) super.addRepeatedField(field, value);
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.alts.internal.Identity) {
return mergeFrom((io.grpc.alts.internal.Identity)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.alts.internal.Identity other) {
if (other == io.grpc.alts.internal.Identity.getDefaultInstance()) return this;
internalGetMutableAttributes().mergeFrom(
other.internalGetAttributes());
switch (other.getIdentityOneofCase()) {
case SERVICE_ACCOUNT: {
identityOneofCase_ = 1;
identityOneof_ = other.identityOneof_;
onChanged();
break;
}
case HOSTNAME: {
identityOneofCase_ = 2;
identityOneof_ = other.identityOneof_;
onChanged();
break;
}
case IDENTITYONEOF_NOT_SET: {
break;
}
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.alts.internal.Identity parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.alts.internal.Identity) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int identityOneofCase_ = 0;
private java.lang.Object identityOneof_;
public IdentityOneofCase
getIdentityOneofCase() {
return IdentityOneofCase.forNumber(
identityOneofCase_);
}
public Builder clearIdentityOneof() {
identityOneofCase_ = 0;
identityOneof_ = null;
onChanged();
return this;
}
private int bitField0_;
/**
* <pre>
* Service account of a connection endpoint.
* </pre>
*
* <code>string service_account = 1;</code>
*/
public java.lang.String getServiceAccount() {
java.lang.Object ref = "";
if (identityOneofCase_ == 1) {
ref = identityOneof_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (identityOneofCase_ == 1) {
identityOneof_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
* Service account of a connection endpoint.
* </pre>
*
* <code>string service_account = 1;</code>
*/
public com.google.protobuf.ByteString
getServiceAccountBytes() {
java.lang.Object ref = "";
if (identityOneofCase_ == 1) {
ref = identityOneof_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (identityOneofCase_ == 1) {
identityOneof_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
* Service account of a connection endpoint.
* </pre>
*
* <code>string service_account = 1;</code>
*/
public Builder setServiceAccount(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
identityOneofCase_ = 1;
identityOneof_ = value;
onChanged();
return this;
}
/**
* <pre>
* Service account of a connection endpoint.
* </pre>
*
* <code>string service_account = 1;</code>
*/
public Builder clearServiceAccount() {
if (identityOneofCase_ == 1) {
identityOneofCase_ = 0;
identityOneof_ = null;
onChanged();
}
return this;
}
/**
* <pre>
* Service account of a connection endpoint.
* </pre>
*
* <code>string service_account = 1;</code>
*/
public Builder setServiceAccountBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
identityOneofCase_ = 1;
identityOneof_ = value;
onChanged();
return this;
}
/**
* <pre>
* Hostname of a connection endpoint.
* </pre>
*
* <code>string hostname = 2;</code>
*/
public java.lang.String getHostname() {
java.lang.Object ref = "";
if (identityOneofCase_ == 2) {
ref = identityOneof_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (identityOneofCase_ == 2) {
identityOneof_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
* Hostname of a connection endpoint.
* </pre>
*
* <code>string hostname = 2;</code>
*/
public com.google.protobuf.ByteString
getHostnameBytes() {
java.lang.Object ref = "";
if (identityOneofCase_ == 2) {
ref = identityOneof_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (identityOneofCase_ == 2) {
identityOneof_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
* Hostname of a connection endpoint.
* </pre>
*
* <code>string hostname = 2;</code>
*/
public Builder setHostname(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
identityOneofCase_ = 2;
identityOneof_ = value;
onChanged();
return this;
}
/**
* <pre>
* Hostname of a connection endpoint.
* </pre>
*
* <code>string hostname = 2;</code>
*/
public Builder clearHostname() {
if (identityOneofCase_ == 2) {
identityOneofCase_ = 0;
identityOneof_ = null;
onChanged();
}
return this;
}
/**
* <pre>
* Hostname of a connection endpoint.
* </pre>
*
* <code>string hostname = 2;</code>
*/
public Builder setHostnameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
identityOneofCase_ = 2;
identityOneof_ = value;
onChanged();
return this;
}
private com.google.protobuf.MapField<
java.lang.String, java.lang.String> attributes_;
private com.google.protobuf.MapField<java.lang.String, java.lang.String>
internalGetAttributes() {
if (attributes_ == null) {
return com.google.protobuf.MapField.emptyMapField(
AttributesDefaultEntryHolder.defaultEntry);
}
return attributes_;
}
private com.google.protobuf.MapField<java.lang.String, java.lang.String>
internalGetMutableAttributes() {
onChanged();;
if (attributes_ == null) {
attributes_ = com.google.protobuf.MapField.newMapField(
AttributesDefaultEntryHolder.defaultEntry);
}
if (!attributes_.isMutable()) {
attributes_ = attributes_.copy();
}
return attributes_;
}
public int getAttributesCount() {
return internalGetAttributes().getMap().size();
}
/**
* <pre>
* Additional attributes of the identity.
* </pre>
*
* <code>map&lt;string, string&gt; attributes = 3;</code>
*/
public boolean containsAttributes(
java.lang.String key) {
if (key == null) { throw new java.lang.NullPointerException(); }
return internalGetAttributes().getMap().containsKey(key);
}
/**
* Use {@link #getAttributesMap()} instead.
*/
@java.lang.Deprecated
public java.util.Map<java.lang.String, java.lang.String> getAttributes() {
return getAttributesMap();
}
/**
* <pre>
* Additional attributes of the identity.
* </pre>
*
* <code>map&lt;string, string&gt; attributes = 3;</code>
*/
public java.util.Map<java.lang.String, java.lang.String> getAttributesMap() {
return internalGetAttributes().getMap();
}
/**
* <pre>
* Additional attributes of the identity.
* </pre>
*
* <code>map&lt;string, string&gt; attributes = 3;</code>
*/
public java.lang.String getAttributesOrDefault(
java.lang.String key,
java.lang.String defaultValue) {
if (key == null) { throw new java.lang.NullPointerException(); }
java.util.Map<java.lang.String, java.lang.String> map =
internalGetAttributes().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
* <pre>
* Additional attributes of the identity.
* </pre>
*
* <code>map&lt;string, string&gt; attributes = 3;</code>
*/
public java.lang.String getAttributesOrThrow(
java.lang.String key) {
if (key == null) { throw new java.lang.NullPointerException(); }
java.util.Map<java.lang.String, java.lang.String> map =
internalGetAttributes().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public Builder clearAttributes() {
internalGetMutableAttributes().getMutableMap()
.clear();
return this;
}
/**
* <pre>
* Additional attributes of the identity.
* </pre>
*
* <code>map&lt;string, string&gt; attributes = 3;</code>
*/
public Builder removeAttributes(
java.lang.String key) {
if (key == null) { throw new java.lang.NullPointerException(); }
internalGetMutableAttributes().getMutableMap()
.remove(key);
return this;
}
/**
* Use alternate mutation accessors instead.
*/
@java.lang.Deprecated
public java.util.Map<java.lang.String, java.lang.String>
getMutableAttributes() {
return internalGetMutableAttributes().getMutableMap();
}
/**
* <pre>
* Additional attributes of the identity.
* </pre>
*
* <code>map&lt;string, string&gt; attributes = 3;</code>
*/
public Builder putAttributes(
java.lang.String key,
java.lang.String value) {
if (key == null) { throw new java.lang.NullPointerException(); }
if (value == null) { throw new java.lang.NullPointerException(); }
internalGetMutableAttributes().getMutableMap()
.put(key, value);
return this;
}
/**
* <pre>
* Additional attributes of the identity.
* </pre>
*
* <code>map&lt;string, string&gt; attributes = 3;</code>
*/
public Builder putAllAttributes(
java.util.Map<java.lang.String, java.lang.String> values) {
internalGetMutableAttributes().getMutableMap()
.putAll(values);
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(unknownFields);
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.mergeUnknownFields(unknownFields);
}
// @@protoc_insertion_point(builder_scope:grpc.gcp.Identity)
}
// @@protoc_insertion_point(class_scope:grpc.gcp.Identity)
private static final io.grpc.alts.internal.Identity DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.alts.internal.Identity();
}
public static io.grpc.alts.internal.Identity getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<Identity>
PARSER = new com.google.protobuf.AbstractParser<Identity>() {
public Identity parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Identity(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<Identity> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<Identity> getParserForType() {
return PARSER;
}
public io.grpc.alts.internal.Identity getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}