com.google.privacy.dlp.v2.CryptoKey Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-google-cloud-dlp-v2 Show documentation
Show all versions of proto-google-cloud-dlp-v2 Show documentation
PROTO library for proto-google-cloud-dlp-v2
/*
* Copyright 2024 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/privacy/dlp/v2/dlp.proto
// Protobuf Java Version: 3.25.4
package com.google.privacy.dlp.v2;
/**
*
*
*
* This is a data encryption key (DEK) (as opposed to
* a key encryption key (KEK) stored by Cloud Key Management Service
* (Cloud KMS).
* When using Cloud KMS to wrap or unwrap a DEK, be sure to set an appropriate
* IAM policy on the KEK to ensure an attacker cannot
* unwrap the DEK.
*
*
* Protobuf type {@code google.privacy.dlp.v2.CryptoKey}
*/
public final class CryptoKey extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.privacy.dlp.v2.CryptoKey)
CryptoKeyOrBuilder {
private static final long serialVersionUID = 0L;
// Use CryptoKey.newBuilder() to construct.
private CryptoKey(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private CryptoKey() {}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new CryptoKey();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.privacy.dlp.v2.DlpProto
.internal_static_google_privacy_dlp_v2_CryptoKey_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.privacy.dlp.v2.DlpProto
.internal_static_google_privacy_dlp_v2_CryptoKey_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.privacy.dlp.v2.CryptoKey.class,
com.google.privacy.dlp.v2.CryptoKey.Builder.class);
}
private int sourceCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object source_;
public enum SourceCase
implements
com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
TRANSIENT(1),
UNWRAPPED(2),
KMS_WRAPPED(3),
SOURCE_NOT_SET(0);
private final int value;
private SourceCase(int value) {
this.value = value;
}
/**
* @param value The number of the enum to look for.
* @return The enum associated with the given number.
* @deprecated Use {@link #forNumber(int)} instead.
*/
@java.lang.Deprecated
public static SourceCase valueOf(int value) {
return forNumber(value);
}
public static SourceCase forNumber(int value) {
switch (value) {
case 1:
return TRANSIENT;
case 2:
return UNWRAPPED;
case 3:
return KMS_WRAPPED;
case 0:
return SOURCE_NOT_SET;
default:
return null;
}
}
public int getNumber() {
return this.value;
}
};
public SourceCase getSourceCase() {
return SourceCase.forNumber(sourceCase_);
}
public static final int TRANSIENT_FIELD_NUMBER = 1;
/**
*
*
*
* Transient crypto key
*
*
* .google.privacy.dlp.v2.TransientCryptoKey transient = 1;
*
* @return Whether the transient field is set.
*/
@java.lang.Override
public boolean hasTransient() {
return sourceCase_ == 1;
}
/**
*
*
*
* Transient crypto key
*
*
* .google.privacy.dlp.v2.TransientCryptoKey transient = 1;
*
* @return The transient.
*/
@java.lang.Override
public com.google.privacy.dlp.v2.TransientCryptoKey getTransient() {
if (sourceCase_ == 1) {
return (com.google.privacy.dlp.v2.TransientCryptoKey) source_;
}
return com.google.privacy.dlp.v2.TransientCryptoKey.getDefaultInstance();
}
/**
*
*
*
* Transient crypto key
*
*
* .google.privacy.dlp.v2.TransientCryptoKey transient = 1;
*/
@java.lang.Override
public com.google.privacy.dlp.v2.TransientCryptoKeyOrBuilder getTransientOrBuilder() {
if (sourceCase_ == 1) {
return (com.google.privacy.dlp.v2.TransientCryptoKey) source_;
}
return com.google.privacy.dlp.v2.TransientCryptoKey.getDefaultInstance();
}
public static final int UNWRAPPED_FIELD_NUMBER = 2;
/**
*
*
*
* Unwrapped crypto key
*
*
* .google.privacy.dlp.v2.UnwrappedCryptoKey unwrapped = 2;
*
* @return Whether the unwrapped field is set.
*/
@java.lang.Override
public boolean hasUnwrapped() {
return sourceCase_ == 2;
}
/**
*
*
*
* Unwrapped crypto key
*
*
* .google.privacy.dlp.v2.UnwrappedCryptoKey unwrapped = 2;
*
* @return The unwrapped.
*/
@java.lang.Override
public com.google.privacy.dlp.v2.UnwrappedCryptoKey getUnwrapped() {
if (sourceCase_ == 2) {
return (com.google.privacy.dlp.v2.UnwrappedCryptoKey) source_;
}
return com.google.privacy.dlp.v2.UnwrappedCryptoKey.getDefaultInstance();
}
/**
*
*
*
* Unwrapped crypto key
*
*
* .google.privacy.dlp.v2.UnwrappedCryptoKey unwrapped = 2;
*/
@java.lang.Override
public com.google.privacy.dlp.v2.UnwrappedCryptoKeyOrBuilder getUnwrappedOrBuilder() {
if (sourceCase_ == 2) {
return (com.google.privacy.dlp.v2.UnwrappedCryptoKey) source_;
}
return com.google.privacy.dlp.v2.UnwrappedCryptoKey.getDefaultInstance();
}
public static final int KMS_WRAPPED_FIELD_NUMBER = 3;
/**
*
*
*
* Key wrapped using Cloud KMS
*
*
* .google.privacy.dlp.v2.KmsWrappedCryptoKey kms_wrapped = 3;
*
* @return Whether the kmsWrapped field is set.
*/
@java.lang.Override
public boolean hasKmsWrapped() {
return sourceCase_ == 3;
}
/**
*
*
*
* Key wrapped using Cloud KMS
*
*
* .google.privacy.dlp.v2.KmsWrappedCryptoKey kms_wrapped = 3;
*
* @return The kmsWrapped.
*/
@java.lang.Override
public com.google.privacy.dlp.v2.KmsWrappedCryptoKey getKmsWrapped() {
if (sourceCase_ == 3) {
return (com.google.privacy.dlp.v2.KmsWrappedCryptoKey) source_;
}
return com.google.privacy.dlp.v2.KmsWrappedCryptoKey.getDefaultInstance();
}
/**
*
*
*
* Key wrapped using Cloud KMS
*
*
* .google.privacy.dlp.v2.KmsWrappedCryptoKey kms_wrapped = 3;
*/
@java.lang.Override
public com.google.privacy.dlp.v2.KmsWrappedCryptoKeyOrBuilder getKmsWrappedOrBuilder() {
if (sourceCase_ == 3) {
return (com.google.privacy.dlp.v2.KmsWrappedCryptoKey) source_;
}
return com.google.privacy.dlp.v2.KmsWrappedCryptoKey.getDefaultInstance();
}
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 (sourceCase_ == 1) {
output.writeMessage(1, (com.google.privacy.dlp.v2.TransientCryptoKey) source_);
}
if (sourceCase_ == 2) {
output.writeMessage(2, (com.google.privacy.dlp.v2.UnwrappedCryptoKey) source_);
}
if (sourceCase_ == 3) {
output.writeMessage(3, (com.google.privacy.dlp.v2.KmsWrappedCryptoKey) source_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (sourceCase_ == 1) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
1, (com.google.privacy.dlp.v2.TransientCryptoKey) source_);
}
if (sourceCase_ == 2) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
2, (com.google.privacy.dlp.v2.UnwrappedCryptoKey) source_);
}
if (sourceCase_ == 3) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
3, (com.google.privacy.dlp.v2.KmsWrappedCryptoKey) source_);
}
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.privacy.dlp.v2.CryptoKey)) {
return super.equals(obj);
}
com.google.privacy.dlp.v2.CryptoKey other = (com.google.privacy.dlp.v2.CryptoKey) obj;
if (!getSourceCase().equals(other.getSourceCase())) return false;
switch (sourceCase_) {
case 1:
if (!getTransient().equals(other.getTransient())) return false;
break;
case 2:
if (!getUnwrapped().equals(other.getUnwrapped())) return false;
break;
case 3:
if (!getKmsWrapped().equals(other.getKmsWrapped())) return false;
break;
case 0:
default:
}
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();
switch (sourceCase_) {
case 1:
hash = (37 * hash) + TRANSIENT_FIELD_NUMBER;
hash = (53 * hash) + getTransient().hashCode();
break;
case 2:
hash = (37 * hash) + UNWRAPPED_FIELD_NUMBER;
hash = (53 * hash) + getUnwrapped().hashCode();
break;
case 3:
hash = (37 * hash) + KMS_WRAPPED_FIELD_NUMBER;
hash = (53 * hash) + getKmsWrapped().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.privacy.dlp.v2.CryptoKey parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.privacy.dlp.v2.CryptoKey parseFrom(
java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.privacy.dlp.v2.CryptoKey parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.privacy.dlp.v2.CryptoKey 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.privacy.dlp.v2.CryptoKey parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.privacy.dlp.v2.CryptoKey parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.privacy.dlp.v2.CryptoKey parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.privacy.dlp.v2.CryptoKey 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.privacy.dlp.v2.CryptoKey parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.privacy.dlp.v2.CryptoKey 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.privacy.dlp.v2.CryptoKey parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.privacy.dlp.v2.CryptoKey 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.privacy.dlp.v2.CryptoKey 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;
}
/**
*
*
*
* This is a data encryption key (DEK) (as opposed to
* a key encryption key (KEK) stored by Cloud Key Management Service
* (Cloud KMS).
* When using Cloud KMS to wrap or unwrap a DEK, be sure to set an appropriate
* IAM policy on the KEK to ensure an attacker cannot
* unwrap the DEK.
*
*
* Protobuf type {@code google.privacy.dlp.v2.CryptoKey}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.privacy.dlp.v2.CryptoKey)
com.google.privacy.dlp.v2.CryptoKeyOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.privacy.dlp.v2.DlpProto
.internal_static_google_privacy_dlp_v2_CryptoKey_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.privacy.dlp.v2.DlpProto
.internal_static_google_privacy_dlp_v2_CryptoKey_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.privacy.dlp.v2.CryptoKey.class,
com.google.privacy.dlp.v2.CryptoKey.Builder.class);
}
// Construct using com.google.privacy.dlp.v2.CryptoKey.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
if (transientBuilder_ != null) {
transientBuilder_.clear();
}
if (unwrappedBuilder_ != null) {
unwrappedBuilder_.clear();
}
if (kmsWrappedBuilder_ != null) {
kmsWrappedBuilder_.clear();
}
sourceCase_ = 0;
source_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.privacy.dlp.v2.DlpProto
.internal_static_google_privacy_dlp_v2_CryptoKey_descriptor;
}
@java.lang.Override
public com.google.privacy.dlp.v2.CryptoKey getDefaultInstanceForType() {
return com.google.privacy.dlp.v2.CryptoKey.getDefaultInstance();
}
@java.lang.Override
public com.google.privacy.dlp.v2.CryptoKey build() {
com.google.privacy.dlp.v2.CryptoKey result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.privacy.dlp.v2.CryptoKey buildPartial() {
com.google.privacy.dlp.v2.CryptoKey result = new com.google.privacy.dlp.v2.CryptoKey(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(com.google.privacy.dlp.v2.CryptoKey result) {
int from_bitField0_ = bitField0_;
}
private void buildPartialOneofs(com.google.privacy.dlp.v2.CryptoKey result) {
result.sourceCase_ = sourceCase_;
result.source_ = this.source_;
if (sourceCase_ == 1 && transientBuilder_ != null) {
result.source_ = transientBuilder_.build();
}
if (sourceCase_ == 2 && unwrappedBuilder_ != null) {
result.source_ = unwrappedBuilder_.build();
}
if (sourceCase_ == 3 && kmsWrappedBuilder_ != null) {
result.source_ = kmsWrappedBuilder_.build();
}
}
@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.privacy.dlp.v2.CryptoKey) {
return mergeFrom((com.google.privacy.dlp.v2.CryptoKey) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.privacy.dlp.v2.CryptoKey other) {
if (other == com.google.privacy.dlp.v2.CryptoKey.getDefaultInstance()) return this;
switch (other.getSourceCase()) {
case TRANSIENT:
{
mergeTransient(other.getTransient());
break;
}
case UNWRAPPED:
{
mergeUnwrapped(other.getUnwrapped());
break;
}
case KMS_WRAPPED:
{
mergeKmsWrapped(other.getKmsWrapped());
break;
}
case SOURCE_NOT_SET:
{
break;
}
}
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 10:
{
input.readMessage(getTransientFieldBuilder().getBuilder(), extensionRegistry);
sourceCase_ = 1;
break;
} // case 10
case 18:
{
input.readMessage(getUnwrappedFieldBuilder().getBuilder(), extensionRegistry);
sourceCase_ = 2;
break;
} // case 18
case 26:
{
input.readMessage(getKmsWrappedFieldBuilder().getBuilder(), extensionRegistry);
sourceCase_ = 3;
break;
} // case 26
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 sourceCase_ = 0;
private java.lang.Object source_;
public SourceCase getSourceCase() {
return SourceCase.forNumber(sourceCase_);
}
public Builder clearSource() {
sourceCase_ = 0;
source_ = null;
onChanged();
return this;
}
private int bitField0_;
private com.google.protobuf.SingleFieldBuilderV3<
com.google.privacy.dlp.v2.TransientCryptoKey,
com.google.privacy.dlp.v2.TransientCryptoKey.Builder,
com.google.privacy.dlp.v2.TransientCryptoKeyOrBuilder>
transientBuilder_;
/**
*
*
*
* Transient crypto key
*
*
* .google.privacy.dlp.v2.TransientCryptoKey transient = 1;
*
* @return Whether the transient field is set.
*/
@java.lang.Override
public boolean hasTransient() {
return sourceCase_ == 1;
}
/**
*
*
*
* Transient crypto key
*
*
* .google.privacy.dlp.v2.TransientCryptoKey transient = 1;
*
* @return The transient.
*/
@java.lang.Override
public com.google.privacy.dlp.v2.TransientCryptoKey getTransient() {
if (transientBuilder_ == null) {
if (sourceCase_ == 1) {
return (com.google.privacy.dlp.v2.TransientCryptoKey) source_;
}
return com.google.privacy.dlp.v2.TransientCryptoKey.getDefaultInstance();
} else {
if (sourceCase_ == 1) {
return transientBuilder_.getMessage();
}
return com.google.privacy.dlp.v2.TransientCryptoKey.getDefaultInstance();
}
}
/**
*
*
*
* Transient crypto key
*
*
* .google.privacy.dlp.v2.TransientCryptoKey transient = 1;
*/
public Builder setTransient(com.google.privacy.dlp.v2.TransientCryptoKey value) {
if (transientBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
source_ = value;
onChanged();
} else {
transientBuilder_.setMessage(value);
}
sourceCase_ = 1;
return this;
}
/**
*
*
*
* Transient crypto key
*
*
* .google.privacy.dlp.v2.TransientCryptoKey transient = 1;
*/
public Builder setTransient(
com.google.privacy.dlp.v2.TransientCryptoKey.Builder builderForValue) {
if (transientBuilder_ == null) {
source_ = builderForValue.build();
onChanged();
} else {
transientBuilder_.setMessage(builderForValue.build());
}
sourceCase_ = 1;
return this;
}
/**
*
*
*
* Transient crypto key
*
*
* .google.privacy.dlp.v2.TransientCryptoKey transient = 1;
*/
public Builder mergeTransient(com.google.privacy.dlp.v2.TransientCryptoKey value) {
if (transientBuilder_ == null) {
if (sourceCase_ == 1
&& source_ != com.google.privacy.dlp.v2.TransientCryptoKey.getDefaultInstance()) {
source_ =
com.google.privacy.dlp.v2.TransientCryptoKey.newBuilder(
(com.google.privacy.dlp.v2.TransientCryptoKey) source_)
.mergeFrom(value)
.buildPartial();
} else {
source_ = value;
}
onChanged();
} else {
if (sourceCase_ == 1) {
transientBuilder_.mergeFrom(value);
} else {
transientBuilder_.setMessage(value);
}
}
sourceCase_ = 1;
return this;
}
/**
*
*
*
* Transient crypto key
*
*
* .google.privacy.dlp.v2.TransientCryptoKey transient = 1;
*/
public Builder clearTransient() {
if (transientBuilder_ == null) {
if (sourceCase_ == 1) {
sourceCase_ = 0;
source_ = null;
onChanged();
}
} else {
if (sourceCase_ == 1) {
sourceCase_ = 0;
source_ = null;
}
transientBuilder_.clear();
}
return this;
}
/**
*
*
*
* Transient crypto key
*
*
* .google.privacy.dlp.v2.TransientCryptoKey transient = 1;
*/
public com.google.privacy.dlp.v2.TransientCryptoKey.Builder getTransientBuilder() {
return getTransientFieldBuilder().getBuilder();
}
/**
*
*
*
* Transient crypto key
*
*
* .google.privacy.dlp.v2.TransientCryptoKey transient = 1;
*/
@java.lang.Override
public com.google.privacy.dlp.v2.TransientCryptoKeyOrBuilder getTransientOrBuilder() {
if ((sourceCase_ == 1) && (transientBuilder_ != null)) {
return transientBuilder_.getMessageOrBuilder();
} else {
if (sourceCase_ == 1) {
return (com.google.privacy.dlp.v2.TransientCryptoKey) source_;
}
return com.google.privacy.dlp.v2.TransientCryptoKey.getDefaultInstance();
}
}
/**
*
*
*
* Transient crypto key
*
*
* .google.privacy.dlp.v2.TransientCryptoKey transient = 1;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.privacy.dlp.v2.TransientCryptoKey,
com.google.privacy.dlp.v2.TransientCryptoKey.Builder,
com.google.privacy.dlp.v2.TransientCryptoKeyOrBuilder>
getTransientFieldBuilder() {
if (transientBuilder_ == null) {
if (!(sourceCase_ == 1)) {
source_ = com.google.privacy.dlp.v2.TransientCryptoKey.getDefaultInstance();
}
transientBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.privacy.dlp.v2.TransientCryptoKey,
com.google.privacy.dlp.v2.TransientCryptoKey.Builder,
com.google.privacy.dlp.v2.TransientCryptoKeyOrBuilder>(
(com.google.privacy.dlp.v2.TransientCryptoKey) source_,
getParentForChildren(),
isClean());
source_ = null;
}
sourceCase_ = 1;
onChanged();
return transientBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.privacy.dlp.v2.UnwrappedCryptoKey,
com.google.privacy.dlp.v2.UnwrappedCryptoKey.Builder,
com.google.privacy.dlp.v2.UnwrappedCryptoKeyOrBuilder>
unwrappedBuilder_;
/**
*
*
*
* Unwrapped crypto key
*
*
* .google.privacy.dlp.v2.UnwrappedCryptoKey unwrapped = 2;
*
* @return Whether the unwrapped field is set.
*/
@java.lang.Override
public boolean hasUnwrapped() {
return sourceCase_ == 2;
}
/**
*
*
*
* Unwrapped crypto key
*
*
* .google.privacy.dlp.v2.UnwrappedCryptoKey unwrapped = 2;
*
* @return The unwrapped.
*/
@java.lang.Override
public com.google.privacy.dlp.v2.UnwrappedCryptoKey getUnwrapped() {
if (unwrappedBuilder_ == null) {
if (sourceCase_ == 2) {
return (com.google.privacy.dlp.v2.UnwrappedCryptoKey) source_;
}
return com.google.privacy.dlp.v2.UnwrappedCryptoKey.getDefaultInstance();
} else {
if (sourceCase_ == 2) {
return unwrappedBuilder_.getMessage();
}
return com.google.privacy.dlp.v2.UnwrappedCryptoKey.getDefaultInstance();
}
}
/**
*
*
*
* Unwrapped crypto key
*
*
* .google.privacy.dlp.v2.UnwrappedCryptoKey unwrapped = 2;
*/
public Builder setUnwrapped(com.google.privacy.dlp.v2.UnwrappedCryptoKey value) {
if (unwrappedBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
source_ = value;
onChanged();
} else {
unwrappedBuilder_.setMessage(value);
}
sourceCase_ = 2;
return this;
}
/**
*
*
*
* Unwrapped crypto key
*
*
* .google.privacy.dlp.v2.UnwrappedCryptoKey unwrapped = 2;
*/
public Builder setUnwrapped(
com.google.privacy.dlp.v2.UnwrappedCryptoKey.Builder builderForValue) {
if (unwrappedBuilder_ == null) {
source_ = builderForValue.build();
onChanged();
} else {
unwrappedBuilder_.setMessage(builderForValue.build());
}
sourceCase_ = 2;
return this;
}
/**
*
*
*
* Unwrapped crypto key
*
*
* .google.privacy.dlp.v2.UnwrappedCryptoKey unwrapped = 2;
*/
public Builder mergeUnwrapped(com.google.privacy.dlp.v2.UnwrappedCryptoKey value) {
if (unwrappedBuilder_ == null) {
if (sourceCase_ == 2
&& source_ != com.google.privacy.dlp.v2.UnwrappedCryptoKey.getDefaultInstance()) {
source_ =
com.google.privacy.dlp.v2.UnwrappedCryptoKey.newBuilder(
(com.google.privacy.dlp.v2.UnwrappedCryptoKey) source_)
.mergeFrom(value)
.buildPartial();
} else {
source_ = value;
}
onChanged();
} else {
if (sourceCase_ == 2) {
unwrappedBuilder_.mergeFrom(value);
} else {
unwrappedBuilder_.setMessage(value);
}
}
sourceCase_ = 2;
return this;
}
/**
*
*
*
* Unwrapped crypto key
*
*
* .google.privacy.dlp.v2.UnwrappedCryptoKey unwrapped = 2;
*/
public Builder clearUnwrapped() {
if (unwrappedBuilder_ == null) {
if (sourceCase_ == 2) {
sourceCase_ = 0;
source_ = null;
onChanged();
}
} else {
if (sourceCase_ == 2) {
sourceCase_ = 0;
source_ = null;
}
unwrappedBuilder_.clear();
}
return this;
}
/**
*
*
*
* Unwrapped crypto key
*
*
* .google.privacy.dlp.v2.UnwrappedCryptoKey unwrapped = 2;
*/
public com.google.privacy.dlp.v2.UnwrappedCryptoKey.Builder getUnwrappedBuilder() {
return getUnwrappedFieldBuilder().getBuilder();
}
/**
*
*
*
* Unwrapped crypto key
*
*
* .google.privacy.dlp.v2.UnwrappedCryptoKey unwrapped = 2;
*/
@java.lang.Override
public com.google.privacy.dlp.v2.UnwrappedCryptoKeyOrBuilder getUnwrappedOrBuilder() {
if ((sourceCase_ == 2) && (unwrappedBuilder_ != null)) {
return unwrappedBuilder_.getMessageOrBuilder();
} else {
if (sourceCase_ == 2) {
return (com.google.privacy.dlp.v2.UnwrappedCryptoKey) source_;
}
return com.google.privacy.dlp.v2.UnwrappedCryptoKey.getDefaultInstance();
}
}
/**
*
*
*
* Unwrapped crypto key
*
*
* .google.privacy.dlp.v2.UnwrappedCryptoKey unwrapped = 2;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.privacy.dlp.v2.UnwrappedCryptoKey,
com.google.privacy.dlp.v2.UnwrappedCryptoKey.Builder,
com.google.privacy.dlp.v2.UnwrappedCryptoKeyOrBuilder>
getUnwrappedFieldBuilder() {
if (unwrappedBuilder_ == null) {
if (!(sourceCase_ == 2)) {
source_ = com.google.privacy.dlp.v2.UnwrappedCryptoKey.getDefaultInstance();
}
unwrappedBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.privacy.dlp.v2.UnwrappedCryptoKey,
com.google.privacy.dlp.v2.UnwrappedCryptoKey.Builder,
com.google.privacy.dlp.v2.UnwrappedCryptoKeyOrBuilder>(
(com.google.privacy.dlp.v2.UnwrappedCryptoKey) source_,
getParentForChildren(),
isClean());
source_ = null;
}
sourceCase_ = 2;
onChanged();
return unwrappedBuilder_;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.privacy.dlp.v2.KmsWrappedCryptoKey,
com.google.privacy.dlp.v2.KmsWrappedCryptoKey.Builder,
com.google.privacy.dlp.v2.KmsWrappedCryptoKeyOrBuilder>
kmsWrappedBuilder_;
/**
*
*
*
* Key wrapped using Cloud KMS
*
*
* .google.privacy.dlp.v2.KmsWrappedCryptoKey kms_wrapped = 3;
*
* @return Whether the kmsWrapped field is set.
*/
@java.lang.Override
public boolean hasKmsWrapped() {
return sourceCase_ == 3;
}
/**
*
*
*
* Key wrapped using Cloud KMS
*
*
* .google.privacy.dlp.v2.KmsWrappedCryptoKey kms_wrapped = 3;
*
* @return The kmsWrapped.
*/
@java.lang.Override
public com.google.privacy.dlp.v2.KmsWrappedCryptoKey getKmsWrapped() {
if (kmsWrappedBuilder_ == null) {
if (sourceCase_ == 3) {
return (com.google.privacy.dlp.v2.KmsWrappedCryptoKey) source_;
}
return com.google.privacy.dlp.v2.KmsWrappedCryptoKey.getDefaultInstance();
} else {
if (sourceCase_ == 3) {
return kmsWrappedBuilder_.getMessage();
}
return com.google.privacy.dlp.v2.KmsWrappedCryptoKey.getDefaultInstance();
}
}
/**
*
*
*
* Key wrapped using Cloud KMS
*
*
* .google.privacy.dlp.v2.KmsWrappedCryptoKey kms_wrapped = 3;
*/
public Builder setKmsWrapped(com.google.privacy.dlp.v2.KmsWrappedCryptoKey value) {
if (kmsWrappedBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
source_ = value;
onChanged();
} else {
kmsWrappedBuilder_.setMessage(value);
}
sourceCase_ = 3;
return this;
}
/**
*
*
*
* Key wrapped using Cloud KMS
*
*
* .google.privacy.dlp.v2.KmsWrappedCryptoKey kms_wrapped = 3;
*/
public Builder setKmsWrapped(
com.google.privacy.dlp.v2.KmsWrappedCryptoKey.Builder builderForValue) {
if (kmsWrappedBuilder_ == null) {
source_ = builderForValue.build();
onChanged();
} else {
kmsWrappedBuilder_.setMessage(builderForValue.build());
}
sourceCase_ = 3;
return this;
}
/**
*
*
*
* Key wrapped using Cloud KMS
*
*
* .google.privacy.dlp.v2.KmsWrappedCryptoKey kms_wrapped = 3;
*/
public Builder mergeKmsWrapped(com.google.privacy.dlp.v2.KmsWrappedCryptoKey value) {
if (kmsWrappedBuilder_ == null) {
if (sourceCase_ == 3
&& source_ != com.google.privacy.dlp.v2.KmsWrappedCryptoKey.getDefaultInstance()) {
source_ =
com.google.privacy.dlp.v2.KmsWrappedCryptoKey.newBuilder(
(com.google.privacy.dlp.v2.KmsWrappedCryptoKey) source_)
.mergeFrom(value)
.buildPartial();
} else {
source_ = value;
}
onChanged();
} else {
if (sourceCase_ == 3) {
kmsWrappedBuilder_.mergeFrom(value);
} else {
kmsWrappedBuilder_.setMessage(value);
}
}
sourceCase_ = 3;
return this;
}
/**
*
*
*
* Key wrapped using Cloud KMS
*
*
* .google.privacy.dlp.v2.KmsWrappedCryptoKey kms_wrapped = 3;
*/
public Builder clearKmsWrapped() {
if (kmsWrappedBuilder_ == null) {
if (sourceCase_ == 3) {
sourceCase_ = 0;
source_ = null;
onChanged();
}
} else {
if (sourceCase_ == 3) {
sourceCase_ = 0;
source_ = null;
}
kmsWrappedBuilder_.clear();
}
return this;
}
/**
*
*
*
* Key wrapped using Cloud KMS
*
*
* .google.privacy.dlp.v2.KmsWrappedCryptoKey kms_wrapped = 3;
*/
public com.google.privacy.dlp.v2.KmsWrappedCryptoKey.Builder getKmsWrappedBuilder() {
return getKmsWrappedFieldBuilder().getBuilder();
}
/**
*
*
*
* Key wrapped using Cloud KMS
*
*
* .google.privacy.dlp.v2.KmsWrappedCryptoKey kms_wrapped = 3;
*/
@java.lang.Override
public com.google.privacy.dlp.v2.KmsWrappedCryptoKeyOrBuilder getKmsWrappedOrBuilder() {
if ((sourceCase_ == 3) && (kmsWrappedBuilder_ != null)) {
return kmsWrappedBuilder_.getMessageOrBuilder();
} else {
if (sourceCase_ == 3) {
return (com.google.privacy.dlp.v2.KmsWrappedCryptoKey) source_;
}
return com.google.privacy.dlp.v2.KmsWrappedCryptoKey.getDefaultInstance();
}
}
/**
*
*
*
* Key wrapped using Cloud KMS
*
*
* .google.privacy.dlp.v2.KmsWrappedCryptoKey kms_wrapped = 3;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.privacy.dlp.v2.KmsWrappedCryptoKey,
com.google.privacy.dlp.v2.KmsWrappedCryptoKey.Builder,
com.google.privacy.dlp.v2.KmsWrappedCryptoKeyOrBuilder>
getKmsWrappedFieldBuilder() {
if (kmsWrappedBuilder_ == null) {
if (!(sourceCase_ == 3)) {
source_ = com.google.privacy.dlp.v2.KmsWrappedCryptoKey.getDefaultInstance();
}
kmsWrappedBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.privacy.dlp.v2.KmsWrappedCryptoKey,
com.google.privacy.dlp.v2.KmsWrappedCryptoKey.Builder,
com.google.privacy.dlp.v2.KmsWrappedCryptoKeyOrBuilder>(
(com.google.privacy.dlp.v2.KmsWrappedCryptoKey) source_,
getParentForChildren(),
isClean());
source_ = null;
}
sourceCase_ = 3;
onChanged();
return kmsWrappedBuilder_;
}
@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.privacy.dlp.v2.CryptoKey)
}
// @@protoc_insertion_point(class_scope:google.privacy.dlp.v2.CryptoKey)
private static final com.google.privacy.dlp.v2.CryptoKey DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.privacy.dlp.v2.CryptoKey();
}
public static com.google.privacy.dlp.v2.CryptoKey getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public CryptoKey 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.privacy.dlp.v2.CryptoKey getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}