com.google.cloud.eventarc.publishing.v1.CloudEvent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of proto-google-cloud-eventarc-publishing-v1 Show documentation
Show all versions of proto-google-cloud-eventarc-publishing-v1 Show documentation
Proto library for google-cloud-eventarc-publishing
/*
* 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/cloud/eventarc/publishing/v1/cloud_event.proto
// Protobuf Java Version: 3.25.5
package com.google.cloud.eventarc.publishing.v1;
/**
*
*
*
* CloudEvent represents a vendor-neutral specification for defining the format
* of event data.
*
*
* Protobuf type {@code google.cloud.eventarc.publishing.v1.CloudEvent}
*/
public final class CloudEvent extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.eventarc.publishing.v1.CloudEvent)
CloudEventOrBuilder {
private static final long serialVersionUID = 0L;
// Use CloudEvent.newBuilder() to construct.
private CloudEvent(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private CloudEvent() {
id_ = "";
source_ = "";
specVersion_ = "";
type_ = "";
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new CloudEvent();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.eventarc.publishing.v1.CloudEventProto
.internal_static_google_cloud_eventarc_publishing_v1_CloudEvent_descriptor;
}
@SuppressWarnings({"rawtypes"})
@java.lang.Override
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 5:
return internalGetAttributes();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.eventarc.publishing.v1.CloudEventProto
.internal_static_google_cloud_eventarc_publishing_v1_CloudEvent_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.eventarc.publishing.v1.CloudEvent.class,
com.google.cloud.eventarc.publishing.v1.CloudEvent.Builder.class);
}
public interface CloudEventAttributeValueOrBuilder
extends
// @@protoc_insertion_point(interface_extends:google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue)
com.google.protobuf.MessageOrBuilder {
/**
*
*
*
* Boolean value.
*
*
* bool ce_boolean = 1;
*
* @return Whether the ceBoolean field is set.
*/
boolean hasCeBoolean();
/**
*
*
*
* Boolean value.
*
*
* bool ce_boolean = 1;
*
* @return The ceBoolean.
*/
boolean getCeBoolean();
/**
*
*
*
* Integer value.
*
*
* int32 ce_integer = 2;
*
* @return Whether the ceInteger field is set.
*/
boolean hasCeInteger();
/**
*
*
*
* Integer value.
*
*
* int32 ce_integer = 2;
*
* @return The ceInteger.
*/
int getCeInteger();
/**
*
*
*
* String value.
*
*
* string ce_string = 3;
*
* @return Whether the ceString field is set.
*/
boolean hasCeString();
/**
*
*
*
* String value.
*
*
* string ce_string = 3;
*
* @return The ceString.
*/
java.lang.String getCeString();
/**
*
*
*
* String value.
*
*
* string ce_string = 3;
*
* @return The bytes for ceString.
*/
com.google.protobuf.ByteString getCeStringBytes();
/**
*
*
*
* Bytes value.
*
*
* bytes ce_bytes = 4;
*
* @return Whether the ceBytes field is set.
*/
boolean hasCeBytes();
/**
*
*
*
* Bytes value.
*
*
* bytes ce_bytes = 4;
*
* @return The ceBytes.
*/
com.google.protobuf.ByteString getCeBytes();
/**
*
*
*
* URI value.
*
*
* string ce_uri = 5;
*
* @return Whether the ceUri field is set.
*/
boolean hasCeUri();
/**
*
*
*
* URI value.
*
*
* string ce_uri = 5;
*
* @return The ceUri.
*/
java.lang.String getCeUri();
/**
*
*
*
* URI value.
*
*
* string ce_uri = 5;
*
* @return The bytes for ceUri.
*/
com.google.protobuf.ByteString getCeUriBytes();
/**
*
*
*
* URI-reference value.
*
*
* string ce_uri_ref = 6;
*
* @return Whether the ceUriRef field is set.
*/
boolean hasCeUriRef();
/**
*
*
*
* URI-reference value.
*
*
* string ce_uri_ref = 6;
*
* @return The ceUriRef.
*/
java.lang.String getCeUriRef();
/**
*
*
*
* URI-reference value.
*
*
* string ce_uri_ref = 6;
*
* @return The bytes for ceUriRef.
*/
com.google.protobuf.ByteString getCeUriRefBytes();
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*
* @return Whether the ceTimestamp field is set.
*/
boolean hasCeTimestamp();
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*
* @return The ceTimestamp.
*/
com.google.protobuf.Timestamp getCeTimestamp();
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*/
com.google.protobuf.TimestampOrBuilder getCeTimestampOrBuilder();
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.AttrCase
getAttrCase();
}
/**
*
*
*
* The following abstract data types are available for use in attributes.
*
*
* Protobuf type {@code google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue}
*/
public static final class CloudEventAttributeValue extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue)
CloudEventAttributeValueOrBuilder {
private static final long serialVersionUID = 0L;
// Use CloudEventAttributeValue.newBuilder() to construct.
private CloudEventAttributeValue(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private CloudEventAttributeValue() {}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(UnusedPrivateParameter unused) {
return new CloudEventAttributeValue();
}
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.eventarc.publishing.v1.CloudEventProto
.internal_static_google_cloud_eventarc_publishing_v1_CloudEvent_CloudEventAttributeValue_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.eventarc.publishing.v1.CloudEventProto
.internal_static_google_cloud_eventarc_publishing_v1_CloudEvent_CloudEventAttributeValue_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.class,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.Builder
.class);
}
private int attrCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object attr_;
public enum AttrCase
implements
com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
CE_BOOLEAN(1),
CE_INTEGER(2),
CE_STRING(3),
CE_BYTES(4),
CE_URI(5),
CE_URI_REF(6),
CE_TIMESTAMP(7),
ATTR_NOT_SET(0);
private final int value;
private AttrCase(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 AttrCase valueOf(int value) {
return forNumber(value);
}
public static AttrCase forNumber(int value) {
switch (value) {
case 1:
return CE_BOOLEAN;
case 2:
return CE_INTEGER;
case 3:
return CE_STRING;
case 4:
return CE_BYTES;
case 5:
return CE_URI;
case 6:
return CE_URI_REF;
case 7:
return CE_TIMESTAMP;
case 0:
return ATTR_NOT_SET;
default:
return null;
}
}
public int getNumber() {
return this.value;
}
};
public AttrCase getAttrCase() {
return AttrCase.forNumber(attrCase_);
}
public static final int CE_BOOLEAN_FIELD_NUMBER = 1;
/**
*
*
*
* Boolean value.
*
*
* bool ce_boolean = 1;
*
* @return Whether the ceBoolean field is set.
*/
@java.lang.Override
public boolean hasCeBoolean() {
return attrCase_ == 1;
}
/**
*
*
*
* Boolean value.
*
*
* bool ce_boolean = 1;
*
* @return The ceBoolean.
*/
@java.lang.Override
public boolean getCeBoolean() {
if (attrCase_ == 1) {
return (java.lang.Boolean) attr_;
}
return false;
}
public static final int CE_INTEGER_FIELD_NUMBER = 2;
/**
*
*
*
* Integer value.
*
*
* int32 ce_integer = 2;
*
* @return Whether the ceInteger field is set.
*/
@java.lang.Override
public boolean hasCeInteger() {
return attrCase_ == 2;
}
/**
*
*
*
* Integer value.
*
*
* int32 ce_integer = 2;
*
* @return The ceInteger.
*/
@java.lang.Override
public int getCeInteger() {
if (attrCase_ == 2) {
return (java.lang.Integer) attr_;
}
return 0;
}
public static final int CE_STRING_FIELD_NUMBER = 3;
/**
*
*
*
* String value.
*
*
* string ce_string = 3;
*
* @return Whether the ceString field is set.
*/
public boolean hasCeString() {
return attrCase_ == 3;
}
/**
*
*
*
* String value.
*
*
* string ce_string = 3;
*
* @return The ceString.
*/
public java.lang.String getCeString() {
java.lang.Object ref = "";
if (attrCase_ == 3) {
ref = attr_;
}
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 (attrCase_ == 3) {
attr_ = s;
}
return s;
}
}
/**
*
*
*
* String value.
*
*
* string ce_string = 3;
*
* @return The bytes for ceString.
*/
public com.google.protobuf.ByteString getCeStringBytes() {
java.lang.Object ref = "";
if (attrCase_ == 3) {
ref = attr_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (attrCase_ == 3) {
attr_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CE_BYTES_FIELD_NUMBER = 4;
/**
*
*
*
* Bytes value.
*
*
* bytes ce_bytes = 4;
*
* @return Whether the ceBytes field is set.
*/
@java.lang.Override
public boolean hasCeBytes() {
return attrCase_ == 4;
}
/**
*
*
*
* Bytes value.
*
*
* bytes ce_bytes = 4;
*
* @return The ceBytes.
*/
@java.lang.Override
public com.google.protobuf.ByteString getCeBytes() {
if (attrCase_ == 4) {
return (com.google.protobuf.ByteString) attr_;
}
return com.google.protobuf.ByteString.EMPTY;
}
public static final int CE_URI_FIELD_NUMBER = 5;
/**
*
*
*
* URI value.
*
*
* string ce_uri = 5;
*
* @return Whether the ceUri field is set.
*/
public boolean hasCeUri() {
return attrCase_ == 5;
}
/**
*
*
*
* URI value.
*
*
* string ce_uri = 5;
*
* @return The ceUri.
*/
public java.lang.String getCeUri() {
java.lang.Object ref = "";
if (attrCase_ == 5) {
ref = attr_;
}
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 (attrCase_ == 5) {
attr_ = s;
}
return s;
}
}
/**
*
*
*
* URI value.
*
*
* string ce_uri = 5;
*
* @return The bytes for ceUri.
*/
public com.google.protobuf.ByteString getCeUriBytes() {
java.lang.Object ref = "";
if (attrCase_ == 5) {
ref = attr_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (attrCase_ == 5) {
attr_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CE_URI_REF_FIELD_NUMBER = 6;
/**
*
*
*
* URI-reference value.
*
*
* string ce_uri_ref = 6;
*
* @return Whether the ceUriRef field is set.
*/
public boolean hasCeUriRef() {
return attrCase_ == 6;
}
/**
*
*
*
* URI-reference value.
*
*
* string ce_uri_ref = 6;
*
* @return The ceUriRef.
*/
public java.lang.String getCeUriRef() {
java.lang.Object ref = "";
if (attrCase_ == 6) {
ref = attr_;
}
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 (attrCase_ == 6) {
attr_ = s;
}
return s;
}
}
/**
*
*
*
* URI-reference value.
*
*
* string ce_uri_ref = 6;
*
* @return The bytes for ceUriRef.
*/
public com.google.protobuf.ByteString getCeUriRefBytes() {
java.lang.Object ref = "";
if (attrCase_ == 6) {
ref = attr_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (attrCase_ == 6) {
attr_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int CE_TIMESTAMP_FIELD_NUMBER = 7;
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*
* @return Whether the ceTimestamp field is set.
*/
@java.lang.Override
public boolean hasCeTimestamp() {
return attrCase_ == 7;
}
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*
* @return The ceTimestamp.
*/
@java.lang.Override
public com.google.protobuf.Timestamp getCeTimestamp() {
if (attrCase_ == 7) {
return (com.google.protobuf.Timestamp) attr_;
}
return com.google.protobuf.Timestamp.getDefaultInstance();
}
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getCeTimestampOrBuilder() {
if (attrCase_ == 7) {
return (com.google.protobuf.Timestamp) attr_;
}
return com.google.protobuf.Timestamp.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 (attrCase_ == 1) {
output.writeBool(1, (boolean) ((java.lang.Boolean) attr_));
}
if (attrCase_ == 2) {
output.writeInt32(2, (int) ((java.lang.Integer) attr_));
}
if (attrCase_ == 3) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, attr_);
}
if (attrCase_ == 4) {
output.writeBytes(4, (com.google.protobuf.ByteString) attr_);
}
if (attrCase_ == 5) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, attr_);
}
if (attrCase_ == 6) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 6, attr_);
}
if (attrCase_ == 7) {
output.writeMessage(7, (com.google.protobuf.Timestamp) attr_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (attrCase_ == 1) {
size +=
com.google.protobuf.CodedOutputStream.computeBoolSize(
1, (boolean) ((java.lang.Boolean) attr_));
}
if (attrCase_ == 2) {
size +=
com.google.protobuf.CodedOutputStream.computeInt32Size(
2, (int) ((java.lang.Integer) attr_));
}
if (attrCase_ == 3) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, attr_);
}
if (attrCase_ == 4) {
size +=
com.google.protobuf.CodedOutputStream.computeBytesSize(
4, (com.google.protobuf.ByteString) attr_);
}
if (attrCase_ == 5) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, attr_);
}
if (attrCase_ == 6) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, attr_);
}
if (attrCase_ == 7) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
7, (com.google.protobuf.Timestamp) attr_);
}
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.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue)) {
return super.equals(obj);
}
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue other =
(com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue) obj;
if (!getAttrCase().equals(other.getAttrCase())) return false;
switch (attrCase_) {
case 1:
if (getCeBoolean() != other.getCeBoolean()) return false;
break;
case 2:
if (getCeInteger() != other.getCeInteger()) return false;
break;
case 3:
if (!getCeString().equals(other.getCeString())) return false;
break;
case 4:
if (!getCeBytes().equals(other.getCeBytes())) return false;
break;
case 5:
if (!getCeUri().equals(other.getCeUri())) return false;
break;
case 6:
if (!getCeUriRef().equals(other.getCeUriRef())) return false;
break;
case 7:
if (!getCeTimestamp().equals(other.getCeTimestamp())) 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 (attrCase_) {
case 1:
hash = (37 * hash) + CE_BOOLEAN_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getCeBoolean());
break;
case 2:
hash = (37 * hash) + CE_INTEGER_FIELD_NUMBER;
hash = (53 * hash) + getCeInteger();
break;
case 3:
hash = (37 * hash) + CE_STRING_FIELD_NUMBER;
hash = (53 * hash) + getCeString().hashCode();
break;
case 4:
hash = (37 * hash) + CE_BYTES_FIELD_NUMBER;
hash = (53 * hash) + getCeBytes().hashCode();
break;
case 5:
hash = (37 * hash) + CE_URI_FIELD_NUMBER;
hash = (53 * hash) + getCeUri().hashCode();
break;
case 6:
hash = (37 * hash) + CE_URI_REF_FIELD_NUMBER;
hash = (53 * hash) + getCeUriRef().hashCode();
break;
case 7:
hash = (37 * hash) + CE_TIMESTAMP_FIELD_NUMBER;
hash = (53 * hash) + getCeTimestamp().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
parseFrom(java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
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.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
parseFrom(com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
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.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
parseFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
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.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
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.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
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.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue 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;
}
/**
*
*
*
* The following abstract data types are available for use in attributes.
*
*
* Protobuf type {@code google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue}
*/
public static final class Builder
extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue)
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValueOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.eventarc.publishing.v1.CloudEventProto
.internal_static_google_cloud_eventarc_publishing_v1_CloudEvent_CloudEventAttributeValue_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.eventarc.publishing.v1.CloudEventProto
.internal_static_google_cloud_eventarc_publishing_v1_CloudEvent_CloudEventAttributeValue_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.class,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.Builder
.class);
}
// Construct using
// com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
if (ceTimestampBuilder_ != null) {
ceTimestampBuilder_.clear();
}
attrCase_ = 0;
attr_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.eventarc.publishing.v1.CloudEventProto
.internal_static_google_cloud_eventarc_publishing_v1_CloudEvent_CloudEventAttributeValue_descriptor;
}
@java.lang.Override
public com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
getDefaultInstanceForType() {
return com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue build() {
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue result =
buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
buildPartial() {
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue result =
new com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue result) {
int from_bitField0_ = bitField0_;
}
private void buildPartialOneofs(
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue result) {
result.attrCase_ = attrCase_;
result.attr_ = this.attr_;
if (attrCase_ == 7 && ceTimestampBuilder_ != null) {
result.attr_ = ceTimestampBuilder_.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.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue) {
return mergeFrom(
(com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue other) {
if (other
== com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
.getDefaultInstance()) return this;
switch (other.getAttrCase()) {
case CE_BOOLEAN:
{
setCeBoolean(other.getCeBoolean());
break;
}
case CE_INTEGER:
{
setCeInteger(other.getCeInteger());
break;
}
case CE_STRING:
{
attrCase_ = 3;
attr_ = other.attr_;
onChanged();
break;
}
case CE_BYTES:
{
setCeBytes(other.getCeBytes());
break;
}
case CE_URI:
{
attrCase_ = 5;
attr_ = other.attr_;
onChanged();
break;
}
case CE_URI_REF:
{
attrCase_ = 6;
attr_ = other.attr_;
onChanged();
break;
}
case CE_TIMESTAMP:
{
mergeCeTimestamp(other.getCeTimestamp());
break;
}
case ATTR_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 8:
{
attr_ = input.readBool();
attrCase_ = 1;
break;
} // case 8
case 16:
{
attr_ = input.readInt32();
attrCase_ = 2;
break;
} // case 16
case 26:
{
java.lang.String s = input.readStringRequireUtf8();
attrCase_ = 3;
attr_ = s;
break;
} // case 26
case 34:
{
attr_ = input.readBytes();
attrCase_ = 4;
break;
} // case 34
case 42:
{
java.lang.String s = input.readStringRequireUtf8();
attrCase_ = 5;
attr_ = s;
break;
} // case 42
case 50:
{
java.lang.String s = input.readStringRequireUtf8();
attrCase_ = 6;
attr_ = s;
break;
} // case 50
case 58:
{
input.readMessage(getCeTimestampFieldBuilder().getBuilder(), extensionRegistry);
attrCase_ = 7;
break;
} // case 58
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 attrCase_ = 0;
private java.lang.Object attr_;
public AttrCase getAttrCase() {
return AttrCase.forNumber(attrCase_);
}
public Builder clearAttr() {
attrCase_ = 0;
attr_ = null;
onChanged();
return this;
}
private int bitField0_;
/**
*
*
*
* Boolean value.
*
*
* bool ce_boolean = 1;
*
* @return Whether the ceBoolean field is set.
*/
public boolean hasCeBoolean() {
return attrCase_ == 1;
}
/**
*
*
*
* Boolean value.
*
*
* bool ce_boolean = 1;
*
* @return The ceBoolean.
*/
public boolean getCeBoolean() {
if (attrCase_ == 1) {
return (java.lang.Boolean) attr_;
}
return false;
}
/**
*
*
*
* Boolean value.
*
*
* bool ce_boolean = 1;
*
* @param value The ceBoolean to set.
* @return This builder for chaining.
*/
public Builder setCeBoolean(boolean value) {
attrCase_ = 1;
attr_ = value;
onChanged();
return this;
}
/**
*
*
*
* Boolean value.
*
*
* bool ce_boolean = 1;
*
* @return This builder for chaining.
*/
public Builder clearCeBoolean() {
if (attrCase_ == 1) {
attrCase_ = 0;
attr_ = null;
onChanged();
}
return this;
}
/**
*
*
*
* Integer value.
*
*
* int32 ce_integer = 2;
*
* @return Whether the ceInteger field is set.
*/
public boolean hasCeInteger() {
return attrCase_ == 2;
}
/**
*
*
*
* Integer value.
*
*
* int32 ce_integer = 2;
*
* @return The ceInteger.
*/
public int getCeInteger() {
if (attrCase_ == 2) {
return (java.lang.Integer) attr_;
}
return 0;
}
/**
*
*
*
* Integer value.
*
*
* int32 ce_integer = 2;
*
* @param value The ceInteger to set.
* @return This builder for chaining.
*/
public Builder setCeInteger(int value) {
attrCase_ = 2;
attr_ = value;
onChanged();
return this;
}
/**
*
*
*
* Integer value.
*
*
* int32 ce_integer = 2;
*
* @return This builder for chaining.
*/
public Builder clearCeInteger() {
if (attrCase_ == 2) {
attrCase_ = 0;
attr_ = null;
onChanged();
}
return this;
}
/**
*
*
*
* String value.
*
*
* string ce_string = 3;
*
* @return Whether the ceString field is set.
*/
@java.lang.Override
public boolean hasCeString() {
return attrCase_ == 3;
}
/**
*
*
*
* String value.
*
*
* string ce_string = 3;
*
* @return The ceString.
*/
@java.lang.Override
public java.lang.String getCeString() {
java.lang.Object ref = "";
if (attrCase_ == 3) {
ref = attr_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (attrCase_ == 3) {
attr_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* String value.
*
*
* string ce_string = 3;
*
* @return The bytes for ceString.
*/
@java.lang.Override
public com.google.protobuf.ByteString getCeStringBytes() {
java.lang.Object ref = "";
if (attrCase_ == 3) {
ref = attr_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (attrCase_ == 3) {
attr_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* String value.
*
*
* string ce_string = 3;
*
* @param value The ceString to set.
* @return This builder for chaining.
*/
public Builder setCeString(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
attrCase_ = 3;
attr_ = value;
onChanged();
return this;
}
/**
*
*
*
* String value.
*
*
* string ce_string = 3;
*
* @return This builder for chaining.
*/
public Builder clearCeString() {
if (attrCase_ == 3) {
attrCase_ = 0;
attr_ = null;
onChanged();
}
return this;
}
/**
*
*
*
* String value.
*
*
* string ce_string = 3;
*
* @param value The bytes for ceString to set.
* @return This builder for chaining.
*/
public Builder setCeStringBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
attrCase_ = 3;
attr_ = value;
onChanged();
return this;
}
/**
*
*
*
* Bytes value.
*
*
* bytes ce_bytes = 4;
*
* @return Whether the ceBytes field is set.
*/
public boolean hasCeBytes() {
return attrCase_ == 4;
}
/**
*
*
*
* Bytes value.
*
*
* bytes ce_bytes = 4;
*
* @return The ceBytes.
*/
public com.google.protobuf.ByteString getCeBytes() {
if (attrCase_ == 4) {
return (com.google.protobuf.ByteString) attr_;
}
return com.google.protobuf.ByteString.EMPTY;
}
/**
*
*
*
* Bytes value.
*
*
* bytes ce_bytes = 4;
*
* @param value The ceBytes to set.
* @return This builder for chaining.
*/
public Builder setCeBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
attrCase_ = 4;
attr_ = value;
onChanged();
return this;
}
/**
*
*
*
* Bytes value.
*
*
* bytes ce_bytes = 4;
*
* @return This builder for chaining.
*/
public Builder clearCeBytes() {
if (attrCase_ == 4) {
attrCase_ = 0;
attr_ = null;
onChanged();
}
return this;
}
/**
*
*
*
* URI value.
*
*
* string ce_uri = 5;
*
* @return Whether the ceUri field is set.
*/
@java.lang.Override
public boolean hasCeUri() {
return attrCase_ == 5;
}
/**
*
*
*
* URI value.
*
*
* string ce_uri = 5;
*
* @return The ceUri.
*/
@java.lang.Override
public java.lang.String getCeUri() {
java.lang.Object ref = "";
if (attrCase_ == 5) {
ref = attr_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (attrCase_ == 5) {
attr_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* URI value.
*
*
* string ce_uri = 5;
*
* @return The bytes for ceUri.
*/
@java.lang.Override
public com.google.protobuf.ByteString getCeUriBytes() {
java.lang.Object ref = "";
if (attrCase_ == 5) {
ref = attr_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (attrCase_ == 5) {
attr_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* URI value.
*
*
* string ce_uri = 5;
*
* @param value The ceUri to set.
* @return This builder for chaining.
*/
public Builder setCeUri(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
attrCase_ = 5;
attr_ = value;
onChanged();
return this;
}
/**
*
*
*
* URI value.
*
*
* string ce_uri = 5;
*
* @return This builder for chaining.
*/
public Builder clearCeUri() {
if (attrCase_ == 5) {
attrCase_ = 0;
attr_ = null;
onChanged();
}
return this;
}
/**
*
*
*
* URI value.
*
*
* string ce_uri = 5;
*
* @param value The bytes for ceUri to set.
* @return This builder for chaining.
*/
public Builder setCeUriBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
attrCase_ = 5;
attr_ = value;
onChanged();
return this;
}
/**
*
*
*
* URI-reference value.
*
*
* string ce_uri_ref = 6;
*
* @return Whether the ceUriRef field is set.
*/
@java.lang.Override
public boolean hasCeUriRef() {
return attrCase_ == 6;
}
/**
*
*
*
* URI-reference value.
*
*
* string ce_uri_ref = 6;
*
* @return The ceUriRef.
*/
@java.lang.Override
public java.lang.String getCeUriRef() {
java.lang.Object ref = "";
if (attrCase_ == 6) {
ref = attr_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (attrCase_ == 6) {
attr_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* URI-reference value.
*
*
* string ce_uri_ref = 6;
*
* @return The bytes for ceUriRef.
*/
@java.lang.Override
public com.google.protobuf.ByteString getCeUriRefBytes() {
java.lang.Object ref = "";
if (attrCase_ == 6) {
ref = attr_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (attrCase_ == 6) {
attr_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* URI-reference value.
*
*
* string ce_uri_ref = 6;
*
* @param value The ceUriRef to set.
* @return This builder for chaining.
*/
public Builder setCeUriRef(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
attrCase_ = 6;
attr_ = value;
onChanged();
return this;
}
/**
*
*
*
* URI-reference value.
*
*
* string ce_uri_ref = 6;
*
* @return This builder for chaining.
*/
public Builder clearCeUriRef() {
if (attrCase_ == 6) {
attrCase_ = 0;
attr_ = null;
onChanged();
}
return this;
}
/**
*
*
*
* URI-reference value.
*
*
* string ce_uri_ref = 6;
*
* @param value The bytes for ceUriRef to set.
* @return This builder for chaining.
*/
public Builder setCeUriRefBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
attrCase_ = 6;
attr_ = value;
onChanged();
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
ceTimestampBuilder_;
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*
* @return Whether the ceTimestamp field is set.
*/
@java.lang.Override
public boolean hasCeTimestamp() {
return attrCase_ == 7;
}
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*
* @return The ceTimestamp.
*/
@java.lang.Override
public com.google.protobuf.Timestamp getCeTimestamp() {
if (ceTimestampBuilder_ == null) {
if (attrCase_ == 7) {
return (com.google.protobuf.Timestamp) attr_;
}
return com.google.protobuf.Timestamp.getDefaultInstance();
} else {
if (attrCase_ == 7) {
return ceTimestampBuilder_.getMessage();
}
return com.google.protobuf.Timestamp.getDefaultInstance();
}
}
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*/
public Builder setCeTimestamp(com.google.protobuf.Timestamp value) {
if (ceTimestampBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
attr_ = value;
onChanged();
} else {
ceTimestampBuilder_.setMessage(value);
}
attrCase_ = 7;
return this;
}
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*/
public Builder setCeTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) {
if (ceTimestampBuilder_ == null) {
attr_ = builderForValue.build();
onChanged();
} else {
ceTimestampBuilder_.setMessage(builderForValue.build());
}
attrCase_ = 7;
return this;
}
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*/
public Builder mergeCeTimestamp(com.google.protobuf.Timestamp value) {
if (ceTimestampBuilder_ == null) {
if (attrCase_ == 7 && attr_ != com.google.protobuf.Timestamp.getDefaultInstance()) {
attr_ =
com.google.protobuf.Timestamp.newBuilder((com.google.protobuf.Timestamp) attr_)
.mergeFrom(value)
.buildPartial();
} else {
attr_ = value;
}
onChanged();
} else {
if (attrCase_ == 7) {
ceTimestampBuilder_.mergeFrom(value);
} else {
ceTimestampBuilder_.setMessage(value);
}
}
attrCase_ = 7;
return this;
}
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*/
public Builder clearCeTimestamp() {
if (ceTimestampBuilder_ == null) {
if (attrCase_ == 7) {
attrCase_ = 0;
attr_ = null;
onChanged();
}
} else {
if (attrCase_ == 7) {
attrCase_ = 0;
attr_ = null;
}
ceTimestampBuilder_.clear();
}
return this;
}
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*/
public com.google.protobuf.Timestamp.Builder getCeTimestampBuilder() {
return getCeTimestampFieldBuilder().getBuilder();
}
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*/
@java.lang.Override
public com.google.protobuf.TimestampOrBuilder getCeTimestampOrBuilder() {
if ((attrCase_ == 7) && (ceTimestampBuilder_ != null)) {
return ceTimestampBuilder_.getMessageOrBuilder();
} else {
if (attrCase_ == 7) {
return (com.google.protobuf.Timestamp) attr_;
}
return com.google.protobuf.Timestamp.getDefaultInstance();
}
}
/**
*
*
*
* Timestamp value.
*
*
* .google.protobuf.Timestamp ce_timestamp = 7;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>
getCeTimestampFieldBuilder() {
if (ceTimestampBuilder_ == null) {
if (!(attrCase_ == 7)) {
attr_ = com.google.protobuf.Timestamp.getDefaultInstance();
}
ceTimestampBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Timestamp,
com.google.protobuf.Timestamp.Builder,
com.google.protobuf.TimestampOrBuilder>(
(com.google.protobuf.Timestamp) attr_, getParentForChildren(), isClean());
attr_ = null;
}
attrCase_ = 7;
onChanged();
return ceTimestampBuilder_;
}
@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.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue)
}
// @@protoc_insertion_point(class_scope:google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue)
private static final com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE =
new com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue();
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public CloudEventAttributeValue 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.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
private int dataCase_ = 0;
@SuppressWarnings("serial")
private java.lang.Object data_;
public enum DataCase
implements
com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
BINARY_DATA(6),
TEXT_DATA(7),
PROTO_DATA(8),
DATA_NOT_SET(0);
private final int value;
private DataCase(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 DataCase valueOf(int value) {
return forNumber(value);
}
public static DataCase forNumber(int value) {
switch (value) {
case 6:
return BINARY_DATA;
case 7:
return TEXT_DATA;
case 8:
return PROTO_DATA;
case 0:
return DATA_NOT_SET;
default:
return null;
}
}
public int getNumber() {
return this.value;
}
};
public DataCase getDataCase() {
return DataCase.forNumber(dataCase_);
}
public static final int ID_FIELD_NUMBER = 1;
@SuppressWarnings("serial")
private volatile java.lang.Object id_ = "";
/**
*
*
*
* Required. Identifies the event. Producers MUST ensure that source + id is
* unique for each distinct event.
*
*
* string id = 1 [(.google.api.field_behavior) = REQUIRED];
*
* @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;
}
}
/**
*
*
*
* Required. Identifies the event. Producers MUST ensure that source + id is
* unique for each distinct event.
*
*
* string id = 1 [(.google.api.field_behavior) = REQUIRED];
*
* @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 SOURCE_FIELD_NUMBER = 2;
@SuppressWarnings("serial")
private volatile java.lang.Object source_ = "";
/**
*
*
*
* Required. Identifies the context in which an event happened.
* URI-reference
*
*
* string source = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return The source.
*/
@java.lang.Override
public java.lang.String getSource() {
java.lang.Object ref = source_;
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();
source_ = s;
return s;
}
}
/**
*
*
*
* Required. Identifies the context in which an event happened.
* URI-reference
*
*
* string source = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for source.
*/
@java.lang.Override
public com.google.protobuf.ByteString getSourceBytes() {
java.lang.Object ref = source_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
source_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int SPEC_VERSION_FIELD_NUMBER = 3;
@SuppressWarnings("serial")
private volatile java.lang.Object specVersion_ = "";
/**
*
*
*
* Required. The version of the CloudEvents specification which the event
* uses.
*
*
* string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return The specVersion.
*/
@java.lang.Override
public java.lang.String getSpecVersion() {
java.lang.Object ref = specVersion_;
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();
specVersion_ = s;
return s;
}
}
/**
*
*
*
* Required. The version of the CloudEvents specification which the event
* uses.
*
*
* string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for specVersion.
*/
@java.lang.Override
public com.google.protobuf.ByteString getSpecVersionBytes() {
java.lang.Object ref = specVersion_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
specVersion_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int TYPE_FIELD_NUMBER = 4;
@SuppressWarnings("serial")
private volatile java.lang.Object type_ = "";
/**
*
*
*
* Required. This attribute contains a value describing the type of event
* related to the originating occurrence.
*
*
* string type = 4 [(.google.api.field_behavior) = REQUIRED];
*
* @return The type.
*/
@java.lang.Override
public java.lang.String getType() {
java.lang.Object ref = type_;
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();
type_ = s;
return s;
}
}
/**
*
*
*
* Required. This attribute contains a value describing the type of event
* related to the originating occurrence.
*
*
* string type = 4 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for type.
*/
@java.lang.Override
public com.google.protobuf.ByteString getTypeBytes() {
java.lang.Object ref = type_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
type_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int ATTRIBUTES_FIELD_NUMBER = 5;
private static final class AttributesDefaultEntryHolder {
static final com.google.protobuf.MapEntry<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
defaultEntry =
com.google.protobuf.MapEntry
.
newDefaultInstance(
com.google.cloud.eventarc.publishing.v1.CloudEventProto
.internal_static_google_cloud_eventarc_publishing_v1_CloudEvent_AttributesEntry_descriptor,
com.google.protobuf.WireFormat.FieldType.STRING,
"",
com.google.protobuf.WireFormat.FieldType.MESSAGE,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
.getDefaultInstance());
}
@SuppressWarnings("serial")
private com.google.protobuf.MapField<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
attributes_;
private com.google.protobuf.MapField<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
internalGetAttributes() {
if (attributes_ == null) {
return com.google.protobuf.MapField.emptyMapField(AttributesDefaultEntryHolder.defaultEntry);
}
return attributes_;
}
public int getAttributesCount() {
return internalGetAttributes().getMap().size();
}
/**
*
*
*
* Optional. Used for Optional & Extension Attributes
*
*
*
* map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public boolean containsAttributes(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetAttributes().getMap().containsKey(key);
}
/** Use {@link #getAttributesMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
getAttributes() {
return getAttributesMap();
}
/**
*
*
*
* Optional. Used for Optional & Extension Attributes
*
*
*
* map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public java.util.Map<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
getAttributesMap() {
return internalGetAttributes().getMap();
}
/**
*
*
*
* Optional. Used for Optional & Extension Attributes
*
*
*
* map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public /* nullable */ com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
getAttributesOrDefault(
java.lang.String key,
/* nullable */
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
map = internalGetAttributes().getMap();
return map.containsKey(key) ? map.get(key) : defaultValue;
}
/**
*
*
*
* Optional. Used for Optional & Extension Attributes
*
*
*
* map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
getAttributesOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
map = internalGetAttributes().getMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return map.get(key);
}
public static final int BINARY_DATA_FIELD_NUMBER = 6;
/**
*
*
*
* Optional. Binary data.
*
*
* bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
*
* @return Whether the binaryData field is set.
*/
@java.lang.Override
public boolean hasBinaryData() {
return dataCase_ == 6;
}
/**
*
*
*
* Optional. Binary data.
*
*
* bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The binaryData.
*/
@java.lang.Override
public com.google.protobuf.ByteString getBinaryData() {
if (dataCase_ == 6) {
return (com.google.protobuf.ByteString) data_;
}
return com.google.protobuf.ByteString.EMPTY;
}
public static final int TEXT_DATA_FIELD_NUMBER = 7;
/**
*
*
*
* Optional. Text data.
*
*
* string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
*
* @return Whether the textData field is set.
*/
public boolean hasTextData() {
return dataCase_ == 7;
}
/**
*
*
*
* Optional. Text data.
*
*
* string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The textData.
*/
public java.lang.String getTextData() {
java.lang.Object ref = "";
if (dataCase_ == 7) {
ref = data_;
}
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 (dataCase_ == 7) {
data_ = s;
}
return s;
}
}
/**
*
*
*
* Optional. Text data.
*
*
* string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The bytes for textData.
*/
public com.google.protobuf.ByteString getTextDataBytes() {
java.lang.Object ref = "";
if (dataCase_ == 7) {
ref = data_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (dataCase_ == 7) {
data_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int PROTO_DATA_FIELD_NUMBER = 8;
/**
*
*
*
* Optional. Proto data.
*
*
* .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
*
* @return Whether the protoData field is set.
*/
@java.lang.Override
public boolean hasProtoData() {
return dataCase_ == 8;
}
/**
*
*
*
* Optional. Proto data.
*
*
* .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The protoData.
*/
@java.lang.Override
public com.google.protobuf.Any getProtoData() {
if (dataCase_ == 8) {
return (com.google.protobuf.Any) data_;
}
return com.google.protobuf.Any.getDefaultInstance();
}
/**
*
*
*
* Optional. Proto data.
*
*
* .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
*/
@java.lang.Override
public com.google.protobuf.AnyOrBuilder getProtoDataOrBuilder() {
if (dataCase_ == 8) {
return (com.google.protobuf.Any) data_;
}
return com.google.protobuf.Any.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 (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(source_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, source_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(specVersion_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 3, specVersion_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 4, type_);
}
com.google.protobuf.GeneratedMessageV3.serializeStringMapTo(
output, internalGetAttributes(), AttributesDefaultEntryHolder.defaultEntry, 5);
if (dataCase_ == 6) {
output.writeBytes(6, (com.google.protobuf.ByteString) data_);
}
if (dataCase_ == 7) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 7, data_);
}
if (dataCase_ == 8) {
output.writeMessage(8, (com.google.protobuf.Any) data_);
}
getUnknownFields().writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(id_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(source_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, source_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(specVersion_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, specVersion_);
}
if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(type_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, type_);
}
for (java.util.Map.Entry<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
entry : internalGetAttributes().getMap().entrySet()) {
com.google.protobuf.MapEntry<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
attributes__ =
AttributesDefaultEntryHolder.defaultEntry
.newBuilderForType()
.setKey(entry.getKey())
.setValue(entry.getValue())
.build();
size += com.google.protobuf.CodedOutputStream.computeMessageSize(5, attributes__);
}
if (dataCase_ == 6) {
size +=
com.google.protobuf.CodedOutputStream.computeBytesSize(
6, (com.google.protobuf.ByteString) data_);
}
if (dataCase_ == 7) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(7, data_);
}
if (dataCase_ == 8) {
size +=
com.google.protobuf.CodedOutputStream.computeMessageSize(
8, (com.google.protobuf.Any) data_);
}
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.eventarc.publishing.v1.CloudEvent)) {
return super.equals(obj);
}
com.google.cloud.eventarc.publishing.v1.CloudEvent other =
(com.google.cloud.eventarc.publishing.v1.CloudEvent) obj;
if (!getId().equals(other.getId())) return false;
if (!getSource().equals(other.getSource())) return false;
if (!getSpecVersion().equals(other.getSpecVersion())) return false;
if (!getType().equals(other.getType())) return false;
if (!internalGetAttributes().equals(other.internalGetAttributes())) return false;
if (!getDataCase().equals(other.getDataCase())) return false;
switch (dataCase_) {
case 6:
if (!getBinaryData().equals(other.getBinaryData())) return false;
break;
case 7:
if (!getTextData().equals(other.getTextData())) return false;
break;
case 8:
if (!getProtoData().equals(other.getProtoData())) 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();
hash = (37 * hash) + ID_FIELD_NUMBER;
hash = (53 * hash) + getId().hashCode();
hash = (37 * hash) + SOURCE_FIELD_NUMBER;
hash = (53 * hash) + getSource().hashCode();
hash = (37 * hash) + SPEC_VERSION_FIELD_NUMBER;
hash = (53 * hash) + getSpecVersion().hashCode();
hash = (37 * hash) + TYPE_FIELD_NUMBER;
hash = (53 * hash) + getType().hashCode();
if (!internalGetAttributes().getMap().isEmpty()) {
hash = (37 * hash) + ATTRIBUTES_FIELD_NUMBER;
hash = (53 * hash) + internalGetAttributes().hashCode();
}
switch (dataCase_) {
case 6:
hash = (37 * hash) + BINARY_DATA_FIELD_NUMBER;
hash = (53 * hash) + getBinaryData().hashCode();
break;
case 7:
hash = (37 * hash) + TEXT_DATA_FIELD_NUMBER;
hash = (53 * hash) + getTextData().hashCode();
break;
case 8:
hash = (37 * hash) + PROTO_DATA_FIELD_NUMBER;
hash = (53 * hash) + getProtoData().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + getUnknownFields().hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent 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.eventarc.publishing.v1.CloudEvent parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent 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.eventarc.publishing.v1.CloudEvent parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent 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.eventarc.publishing.v1.CloudEvent parseDelimitedFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent 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.eventarc.publishing.v1.CloudEvent parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent 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.eventarc.publishing.v1.CloudEvent 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;
}
/**
*
*
*
* CloudEvent represents a vendor-neutral specification for defining the format
* of event data.
*
*
* Protobuf type {@code google.cloud.eventarc.publishing.v1.CloudEvent}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder
implements
// @@protoc_insertion_point(builder_implements:google.cloud.eventarc.publishing.v1.CloudEvent)
com.google.cloud.eventarc.publishing.v1.CloudEventOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.eventarc.publishing.v1.CloudEventProto
.internal_static_google_cloud_eventarc_publishing_v1_CloudEvent_descriptor;
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
int number) {
switch (number) {
case 5:
return internalGetAttributes();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@SuppressWarnings({"rawtypes"})
protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
int number) {
switch (number) {
case 5:
return internalGetMutableAttributes();
default:
throw new RuntimeException("Invalid map field number: " + number);
}
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.eventarc.publishing.v1.CloudEventProto
.internal_static_google_cloud_eventarc_publishing_v1_CloudEvent_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.eventarc.publishing.v1.CloudEvent.class,
com.google.cloud.eventarc.publishing.v1.CloudEvent.Builder.class);
}
// Construct using com.google.cloud.eventarc.publishing.v1.CloudEvent.newBuilder()
private Builder() {}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
}
@java.lang.Override
public Builder clear() {
super.clear();
bitField0_ = 0;
id_ = "";
source_ = "";
specVersion_ = "";
type_ = "";
internalGetMutableAttributes().clear();
if (protoDataBuilder_ != null) {
protoDataBuilder_.clear();
}
dataCase_ = 0;
data_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.eventarc.publishing.v1.CloudEventProto
.internal_static_google_cloud_eventarc_publishing_v1_CloudEvent_descriptor;
}
@java.lang.Override
public com.google.cloud.eventarc.publishing.v1.CloudEvent getDefaultInstanceForType() {
return com.google.cloud.eventarc.publishing.v1.CloudEvent.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.eventarc.publishing.v1.CloudEvent build() {
com.google.cloud.eventarc.publishing.v1.CloudEvent result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.eventarc.publishing.v1.CloudEvent buildPartial() {
com.google.cloud.eventarc.publishing.v1.CloudEvent result =
new com.google.cloud.eventarc.publishing.v1.CloudEvent(this);
if (bitField0_ != 0) {
buildPartial0(result);
}
buildPartialOneofs(result);
onBuilt();
return result;
}
private void buildPartial0(com.google.cloud.eventarc.publishing.v1.CloudEvent result) {
int from_bitField0_ = bitField0_;
if (((from_bitField0_ & 0x00000001) != 0)) {
result.id_ = id_;
}
if (((from_bitField0_ & 0x00000002) != 0)) {
result.source_ = source_;
}
if (((from_bitField0_ & 0x00000004) != 0)) {
result.specVersion_ = specVersion_;
}
if (((from_bitField0_ & 0x00000008) != 0)) {
result.type_ = type_;
}
if (((from_bitField0_ & 0x00000010) != 0)) {
result.attributes_ =
internalGetAttributes().build(AttributesDefaultEntryHolder.defaultEntry);
}
}
private void buildPartialOneofs(com.google.cloud.eventarc.publishing.v1.CloudEvent result) {
result.dataCase_ = dataCase_;
result.data_ = this.data_;
if (dataCase_ == 8 && protoDataBuilder_ != null) {
result.data_ = protoDataBuilder_.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.cloud.eventarc.publishing.v1.CloudEvent) {
return mergeFrom((com.google.cloud.eventarc.publishing.v1.CloudEvent) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.google.cloud.eventarc.publishing.v1.CloudEvent other) {
if (other == com.google.cloud.eventarc.publishing.v1.CloudEvent.getDefaultInstance())
return this;
if (!other.getId().isEmpty()) {
id_ = other.id_;
bitField0_ |= 0x00000001;
onChanged();
}
if (!other.getSource().isEmpty()) {
source_ = other.source_;
bitField0_ |= 0x00000002;
onChanged();
}
if (!other.getSpecVersion().isEmpty()) {
specVersion_ = other.specVersion_;
bitField0_ |= 0x00000004;
onChanged();
}
if (!other.getType().isEmpty()) {
type_ = other.type_;
bitField0_ |= 0x00000008;
onChanged();
}
internalGetMutableAttributes().mergeFrom(other.internalGetAttributes());
bitField0_ |= 0x00000010;
switch (other.getDataCase()) {
case BINARY_DATA:
{
setBinaryData(other.getBinaryData());
break;
}
case TEXT_DATA:
{
dataCase_ = 7;
data_ = other.data_;
onChanged();
break;
}
case PROTO_DATA:
{
mergeProtoData(other.getProtoData());
break;
}
case DATA_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:
{
id_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000001;
break;
} // case 10
case 18:
{
source_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000002;
break;
} // case 18
case 26:
{
specVersion_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000004;
break;
} // case 26
case 34:
{
type_ = input.readStringRequireUtf8();
bitField0_ |= 0x00000008;
break;
} // case 34
case 42:
{
com.google.protobuf.MapEntry<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
attributes__ =
input.readMessage(
AttributesDefaultEntryHolder.defaultEntry.getParserForType(),
extensionRegistry);
internalGetMutableAttributes()
.ensureBuilderMap()
.put(attributes__.getKey(), attributes__.getValue());
bitField0_ |= 0x00000010;
break;
} // case 42
case 50:
{
data_ = input.readBytes();
dataCase_ = 6;
break;
} // case 50
case 58:
{
java.lang.String s = input.readStringRequireUtf8();
dataCase_ = 7;
data_ = s;
break;
} // case 58
case 66:
{
input.readMessage(getProtoDataFieldBuilder().getBuilder(), extensionRegistry);
dataCase_ = 8;
break;
} // case 66
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 dataCase_ = 0;
private java.lang.Object data_;
public DataCase getDataCase() {
return DataCase.forNumber(dataCase_);
}
public Builder clearData() {
dataCase_ = 0;
data_ = null;
onChanged();
return this;
}
private int bitField0_;
private java.lang.Object id_ = "";
/**
*
*
*
* Required. Identifies the event. Producers MUST ensure that source + id is
* unique for each distinct event.
*
*
* string id = 1 [(.google.api.field_behavior) = REQUIRED];
*
* @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;
}
}
/**
*
*
*
* Required. Identifies the event. Producers MUST ensure that source + id is
* unique for each distinct event.
*
*
* string id = 1 [(.google.api.field_behavior) = REQUIRED];
*
* @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;
}
}
/**
*
*
*
* Required. Identifies the event. Producers MUST ensure that source + id is
* unique for each distinct event.
*
*
* string id = 1 [(.google.api.field_behavior) = REQUIRED];
*
* @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_ |= 0x00000001;
onChanged();
return this;
}
/**
*
*
*
* Required. Identifies the event. Producers MUST ensure that source + id is
* unique for each distinct event.
*
*
* string id = 1 [(.google.api.field_behavior) = REQUIRED];
*
* @return This builder for chaining.
*/
public Builder clearId() {
id_ = getDefaultInstance().getId();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
return this;
}
/**
*
*
*
* Required. Identifies the event. Producers MUST ensure that source + id is
* unique for each distinct event.
*
*
* string id = 1 [(.google.api.field_behavior) = REQUIRED];
*
* @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_ |= 0x00000001;
onChanged();
return this;
}
private java.lang.Object source_ = "";
/**
*
*
*
* Required. Identifies the context in which an event happened.
* URI-reference
*
*
* string source = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return The source.
*/
public java.lang.String getSource() {
java.lang.Object ref = source_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
source_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Required. Identifies the context in which an event happened.
* URI-reference
*
*
* string source = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for source.
*/
public com.google.protobuf.ByteString getSourceBytes() {
java.lang.Object ref = source_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
source_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Required. Identifies the context in which an event happened.
* URI-reference
*
*
* string source = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The source to set.
* @return This builder for chaining.
*/
public Builder setSource(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
source_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
/**
*
*
*
* Required. Identifies the context in which an event happened.
* URI-reference
*
*
* string source = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @return This builder for chaining.
*/
public Builder clearSource() {
source_ = getDefaultInstance().getSource();
bitField0_ = (bitField0_ & ~0x00000002);
onChanged();
return this;
}
/**
*
*
*
* Required. Identifies the context in which an event happened.
* URI-reference
*
*
* string source = 2 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The bytes for source to set.
* @return This builder for chaining.
*/
public Builder setSourceBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
source_ = value;
bitField0_ |= 0x00000002;
onChanged();
return this;
}
private java.lang.Object specVersion_ = "";
/**
*
*
*
* Required. The version of the CloudEvents specification which the event
* uses.
*
*
* string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return The specVersion.
*/
public java.lang.String getSpecVersion() {
java.lang.Object ref = specVersion_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
specVersion_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Required. The version of the CloudEvents specification which the event
* uses.
*
*
* string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for specVersion.
*/
public com.google.protobuf.ByteString getSpecVersionBytes() {
java.lang.Object ref = specVersion_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
specVersion_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Required. The version of the CloudEvents specification which the event
* uses.
*
*
* string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The specVersion to set.
* @return This builder for chaining.
*/
public Builder setSpecVersion(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
specVersion_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
/**
*
*
*
* Required. The version of the CloudEvents specification which the event
* uses.
*
*
* string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @return This builder for chaining.
*/
public Builder clearSpecVersion() {
specVersion_ = getDefaultInstance().getSpecVersion();
bitField0_ = (bitField0_ & ~0x00000004);
onChanged();
return this;
}
/**
*
*
*
* Required. The version of the CloudEvents specification which the event
* uses.
*
*
* string spec_version = 3 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The bytes for specVersion to set.
* @return This builder for chaining.
*/
public Builder setSpecVersionBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
specVersion_ = value;
bitField0_ |= 0x00000004;
onChanged();
return this;
}
private java.lang.Object type_ = "";
/**
*
*
*
* Required. This attribute contains a value describing the type of event
* related to the originating occurrence.
*
*
* string type = 4 [(.google.api.field_behavior) = REQUIRED];
*
* @return The type.
*/
public java.lang.String getType() {
java.lang.Object ref = type_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
type_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Required. This attribute contains a value describing the type of event
* related to the originating occurrence.
*
*
* string type = 4 [(.google.api.field_behavior) = REQUIRED];
*
* @return The bytes for type.
*/
public com.google.protobuf.ByteString getTypeBytes() {
java.lang.Object ref = type_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
type_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Required. This attribute contains a value describing the type of event
* related to the originating occurrence.
*
*
* string type = 4 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The type to set.
* @return This builder for chaining.
*/
public Builder setType(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
type_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
/**
*
*
*
* Required. This attribute contains a value describing the type of event
* related to the originating occurrence.
*
*
* string type = 4 [(.google.api.field_behavior) = REQUIRED];
*
* @return This builder for chaining.
*/
public Builder clearType() {
type_ = getDefaultInstance().getType();
bitField0_ = (bitField0_ & ~0x00000008);
onChanged();
return this;
}
/**
*
*
*
* Required. This attribute contains a value describing the type of event
* related to the originating occurrence.
*
*
* string type = 4 [(.google.api.field_behavior) = REQUIRED];
*
* @param value The bytes for type to set.
* @return This builder for chaining.
*/
public Builder setTypeBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
type_ = value;
bitField0_ |= 0x00000008;
onChanged();
return this;
}
private static final class AttributesConverter
implements com.google.protobuf.MapFieldBuilder.Converter<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValueOrBuilder,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> {
@java.lang.Override
public com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue build(
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValueOrBuilder
val) {
if (val
instanceof
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue) {
return (com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue) val;
}
return ((com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
.Builder)
val)
.build();
}
@java.lang.Override
public com.google.protobuf.MapEntry<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
defaultEntry() {
return AttributesDefaultEntryHolder.defaultEntry;
}
};
private static final AttributesConverter attributesConverter = new AttributesConverter();
private com.google.protobuf.MapFieldBuilder<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValueOrBuilder,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.Builder>
attributes_;
private com.google.protobuf.MapFieldBuilder<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValueOrBuilder,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.Builder>
internalGetAttributes() {
if (attributes_ == null) {
return new com.google.protobuf.MapFieldBuilder<>(attributesConverter);
}
return attributes_;
}
private com.google.protobuf.MapFieldBuilder<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValueOrBuilder,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.Builder>
internalGetMutableAttributes() {
if (attributes_ == null) {
attributes_ = new com.google.protobuf.MapFieldBuilder<>(attributesConverter);
}
bitField0_ |= 0x00000010;
onChanged();
return attributes_;
}
public int getAttributesCount() {
return internalGetAttributes().ensureBuilderMap().size();
}
/**
*
*
*
* Optional. Used for Optional & Extension Attributes
*
*
*
* map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public boolean containsAttributes(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
return internalGetAttributes().ensureBuilderMap().containsKey(key);
}
/** Use {@link #getAttributesMap()} instead. */
@java.lang.Override
@java.lang.Deprecated
public java.util.Map<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
getAttributes() {
return getAttributesMap();
}
/**
*
*
*
* Optional. Used for Optional & Extension Attributes
*
*
*
* map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public java.util.Map<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
getAttributesMap() {
return internalGetAttributes().getImmutableMap();
}
/**
*
*
*
* Optional. Used for Optional & Extension Attributes
*
*
*
* map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public /* nullable */ com.google.cloud.eventarc.publishing.v1.CloudEvent
.CloudEventAttributeValue
getAttributesOrDefault(
java.lang.String key,
/* nullable */
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
defaultValue) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValueOrBuilder>
map = internalGetMutableAttributes().ensureBuilderMap();
return map.containsKey(key) ? attributesConverter.build(map.get(key)) : defaultValue;
}
/**
*
*
*
* Optional. Used for Optional & Extension Attributes
*
*
*
* map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
*
*/
@java.lang.Override
public com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
getAttributesOrThrow(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
java.util.Map<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValueOrBuilder>
map = internalGetMutableAttributes().ensureBuilderMap();
if (!map.containsKey(key)) {
throw new java.lang.IllegalArgumentException();
}
return attributesConverter.build(map.get(key));
}
public Builder clearAttributes() {
bitField0_ = (bitField0_ & ~0x00000010);
internalGetMutableAttributes().clear();
return this;
}
/**
*
*
*
* Optional. Used for Optional & Extension Attributes
*
*
*
* map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public Builder removeAttributes(java.lang.String key) {
if (key == null) {
throw new NullPointerException("map key");
}
internalGetMutableAttributes().ensureBuilderMap().remove(key);
return this;
}
/** Use alternate mutation accessors instead. */
@java.lang.Deprecated
public java.util.Map<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
getMutableAttributes() {
bitField0_ |= 0x00000010;
return internalGetMutableAttributes().ensureMessageMap();
}
/**
*
*
*
* Optional. Used for Optional & Extension Attributes
*
*
*
* map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public Builder putAttributes(
java.lang.String key,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue value) {
if (key == null) {
throw new NullPointerException("map key");
}
if (value == null) {
throw new NullPointerException("map value");
}
internalGetMutableAttributes().ensureBuilderMap().put(key, value);
bitField0_ |= 0x00000010;
return this;
}
/**
*
*
*
* Optional. Used for Optional & Extension Attributes
*
*
*
* map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public Builder putAllAttributes(
java.util.Map<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
values) {
for (java.util.Map.Entry<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue>
e : values.entrySet()) {
if (e.getKey() == null || e.getValue() == null) {
throw new NullPointerException();
}
}
internalGetMutableAttributes().ensureBuilderMap().putAll(values);
bitField0_ |= 0x00000010;
return this;
}
/**
*
*
*
* Optional. Used for Optional & Extension Attributes
*
*
*
* map<string, .google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue> attributes = 5 [(.google.api.field_behavior) = OPTIONAL];
*
*/
public com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.Builder
putAttributesBuilderIfAbsent(java.lang.String key) {
java.util.Map<
java.lang.String,
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValueOrBuilder>
builderMap = internalGetMutableAttributes().ensureBuilderMap();
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValueOrBuilder entry =
builderMap.get(key);
if (entry == null) {
entry =
com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue
.newBuilder();
builderMap.put(key, entry);
}
if (entry
instanceof com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue) {
entry =
((com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue) entry)
.toBuilder();
builderMap.put(key, entry);
}
return (com.google.cloud.eventarc.publishing.v1.CloudEvent.CloudEventAttributeValue.Builder)
entry;
}
/**
*
*
*
* Optional. Binary data.
*
*
* bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
*
* @return Whether the binaryData field is set.
*/
public boolean hasBinaryData() {
return dataCase_ == 6;
}
/**
*
*
*
* Optional. Binary data.
*
*
* bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The binaryData.
*/
public com.google.protobuf.ByteString getBinaryData() {
if (dataCase_ == 6) {
return (com.google.protobuf.ByteString) data_;
}
return com.google.protobuf.ByteString.EMPTY;
}
/**
*
*
*
* Optional. Binary data.
*
*
* bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The binaryData to set.
* @return This builder for chaining.
*/
public Builder setBinaryData(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
dataCase_ = 6;
data_ = value;
onChanged();
return this;
}
/**
*
*
*
* Optional. Binary data.
*
*
* bytes binary_data = 6 [(.google.api.field_behavior) = OPTIONAL];
*
* @return This builder for chaining.
*/
public Builder clearBinaryData() {
if (dataCase_ == 6) {
dataCase_ = 0;
data_ = null;
onChanged();
}
return this;
}
/**
*
*
*
* Optional. Text data.
*
*
* string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
*
* @return Whether the textData field is set.
*/
@java.lang.Override
public boolean hasTextData() {
return dataCase_ == 7;
}
/**
*
*
*
* Optional. Text data.
*
*
* string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The textData.
*/
@java.lang.Override
public java.lang.String getTextData() {
java.lang.Object ref = "";
if (dataCase_ == 7) {
ref = data_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (dataCase_ == 7) {
data_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
*
* Optional. Text data.
*
*
* string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The bytes for textData.
*/
@java.lang.Override
public com.google.protobuf.ByteString getTextDataBytes() {
java.lang.Object ref = "";
if (dataCase_ == 7) {
ref = data_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
if (dataCase_ == 7) {
data_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
*
* Optional. Text data.
*
*
* string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The textData to set.
* @return This builder for chaining.
*/
public Builder setTextData(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
dataCase_ = 7;
data_ = value;
onChanged();
return this;
}
/**
*
*
*
* Optional. Text data.
*
*
* string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
*
* @return This builder for chaining.
*/
public Builder clearTextData() {
if (dataCase_ == 7) {
dataCase_ = 0;
data_ = null;
onChanged();
}
return this;
}
/**
*
*
*
* Optional. Text data.
*
*
* string text_data = 7 [(.google.api.field_behavior) = OPTIONAL];
*
* @param value The bytes for textData to set.
* @return This builder for chaining.
*/
public Builder setTextDataBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
dataCase_ = 7;
data_ = value;
onChanged();
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Any,
com.google.protobuf.Any.Builder,
com.google.protobuf.AnyOrBuilder>
protoDataBuilder_;
/**
*
*
*
* Optional. Proto data.
*
*
* .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
*
* @return Whether the protoData field is set.
*/
@java.lang.Override
public boolean hasProtoData() {
return dataCase_ == 8;
}
/**
*
*
*
* Optional. Proto data.
*
*
* .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
*
* @return The protoData.
*/
@java.lang.Override
public com.google.protobuf.Any getProtoData() {
if (protoDataBuilder_ == null) {
if (dataCase_ == 8) {
return (com.google.protobuf.Any) data_;
}
return com.google.protobuf.Any.getDefaultInstance();
} else {
if (dataCase_ == 8) {
return protoDataBuilder_.getMessage();
}
return com.google.protobuf.Any.getDefaultInstance();
}
}
/**
*
*
*
* Optional. Proto data.
*
*
* .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
*/
public Builder setProtoData(com.google.protobuf.Any value) {
if (protoDataBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
data_ = value;
onChanged();
} else {
protoDataBuilder_.setMessage(value);
}
dataCase_ = 8;
return this;
}
/**
*
*
*
* Optional. Proto data.
*
*
* .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
*/
public Builder setProtoData(com.google.protobuf.Any.Builder builderForValue) {
if (protoDataBuilder_ == null) {
data_ = builderForValue.build();
onChanged();
} else {
protoDataBuilder_.setMessage(builderForValue.build());
}
dataCase_ = 8;
return this;
}
/**
*
*
*
* Optional. Proto data.
*
*
* .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
*/
public Builder mergeProtoData(com.google.protobuf.Any value) {
if (protoDataBuilder_ == null) {
if (dataCase_ == 8 && data_ != com.google.protobuf.Any.getDefaultInstance()) {
data_ =
com.google.protobuf.Any.newBuilder((com.google.protobuf.Any) data_)
.mergeFrom(value)
.buildPartial();
} else {
data_ = value;
}
onChanged();
} else {
if (dataCase_ == 8) {
protoDataBuilder_.mergeFrom(value);
} else {
protoDataBuilder_.setMessage(value);
}
}
dataCase_ = 8;
return this;
}
/**
*
*
*
* Optional. Proto data.
*
*
* .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
*/
public Builder clearProtoData() {
if (protoDataBuilder_ == null) {
if (dataCase_ == 8) {
dataCase_ = 0;
data_ = null;
onChanged();
}
} else {
if (dataCase_ == 8) {
dataCase_ = 0;
data_ = null;
}
protoDataBuilder_.clear();
}
return this;
}
/**
*
*
*
* Optional. Proto data.
*
*
* .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
*/
public com.google.protobuf.Any.Builder getProtoDataBuilder() {
return getProtoDataFieldBuilder().getBuilder();
}
/**
*
*
*
* Optional. Proto data.
*
*
* .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
*/
@java.lang.Override
public com.google.protobuf.AnyOrBuilder getProtoDataOrBuilder() {
if ((dataCase_ == 8) && (protoDataBuilder_ != null)) {
return protoDataBuilder_.getMessageOrBuilder();
} else {
if (dataCase_ == 8) {
return (com.google.protobuf.Any) data_;
}
return com.google.protobuf.Any.getDefaultInstance();
}
}
/**
*
*
*
* Optional. Proto data.
*
*
* .google.protobuf.Any proto_data = 8 [(.google.api.field_behavior) = OPTIONAL];
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Any,
com.google.protobuf.Any.Builder,
com.google.protobuf.AnyOrBuilder>
getProtoDataFieldBuilder() {
if (protoDataBuilder_ == null) {
if (!(dataCase_ == 8)) {
data_ = com.google.protobuf.Any.getDefaultInstance();
}
protoDataBuilder_ =
new com.google.protobuf.SingleFieldBuilderV3<
com.google.protobuf.Any,
com.google.protobuf.Any.Builder,
com.google.protobuf.AnyOrBuilder>(
(com.google.protobuf.Any) data_, getParentForChildren(), isClean());
data_ = null;
}
dataCase_ = 8;
onChanged();
return protoDataBuilder_;
}
@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.eventarc.publishing.v1.CloudEvent)
}
// @@protoc_insertion_point(class_scope:google.cloud.eventarc.publishing.v1.CloudEvent)
private static final com.google.cloud.eventarc.publishing.v1.CloudEvent DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.eventarc.publishing.v1.CloudEvent();
}
public static com.google.cloud.eventarc.publishing.v1.CloudEvent getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser PARSER =
new com.google.protobuf.AbstractParser() {
@java.lang.Override
public CloudEvent 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.eventarc.publishing.v1.CloudEvent getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy