com.clarifai.grpc.api.utils.TestProto Maven / Gradle / Ivy
The newest version!
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: proto/clarifai/api/utils/test_proto.proto
package com.clarifai.grpc.api.utils;
/**
* Protobuf type {@code clarifai.api.utils.TestProto}
*/
public final class TestProto extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:clarifai.api.utils.TestProto)
TestProtoOrBuilder {
private static final long serialVersionUID = 0L;
// Use TestProto.newBuilder() to construct.
private TestProto(com.google.protobuf.GeneratedMessageV3.Builder> builder) {
super(builder);
}
private TestProto() {
id_ = "";
message_ = "";
imageBytes_ = com.google.protobuf.ByteString.EMPTY;
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new TestProto();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private TestProto(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10: {
java.lang.String s = input.readStringRequireUtf8();
id_ = s;
break;
}
case 18: {
java.lang.String s = input.readStringRequireUtf8();
message_ = s;
break;
}
case 25: {
value_ = input.readDouble();
break;
}
case 34: {
imageBytes_ = input.readBytes();
break;
}
case 42: {
java.lang.String s = input.readStringRequireUtf8();
oneOfFieldCase_ = 5;
oneOfField_ = s;
break;
}
case 48: {
oneOfField_ = input.readBool();
oneOfFieldCase_ = 6;
break;
}
case 58: {
com.clarifai.grpc.api.utils.TestProto2.Builder subBuilder = null;
if (oneOfFieldCase_ == 7) {
subBuilder = ((com.clarifai.grpc.api.utils.TestProto2) oneOfField_).toBuilder();
}
oneOfField_ =
input.readMessage(com.clarifai.grpc.api.utils.TestProto2.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom((com.clarifai.grpc.api.utils.TestProto2) oneOfField_);
oneOfField_ = subBuilder.buildPartial();
}
oneOfFieldCase_ = 7;
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (com.google.protobuf.UninitializedMessageException e) {
throw e.asInvalidProtocolBufferException().setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.clarifai.grpc.api.utils.TestProtoOuterClass.internal_static_clarifai_api_utils_TestProto_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.clarifai.grpc.api.utils.TestProtoOuterClass.internal_static_clarifai_api_utils_TestProto_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.clarifai.grpc.api.utils.TestProto.class, com.clarifai.grpc.api.utils.TestProto.Builder.class);
}
private int oneOfFieldCase_ = 0;
private java.lang.Object oneOfField_;
public enum OneOfFieldCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
STRING_ONEOF(5),
BOOL_ONEOF(6),
MESSAGE_ONEOF(7),
ONEOFFIELD_NOT_SET(0);
private final int value;
private OneOfFieldCase(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 OneOfFieldCase valueOf(int value) {
return forNumber(value);
}
public static OneOfFieldCase forNumber(int value) {
switch (value) {
case 5: return STRING_ONEOF;
case 6: return BOOL_ONEOF;
case 7: return MESSAGE_ONEOF;
case 0: return ONEOFFIELD_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public OneOfFieldCase
getOneOfFieldCase() {
return OneOfFieldCase.forNumber(
oneOfFieldCase_);
}
public static final int ID_FIELD_NUMBER = 1;
private volatile java.lang.Object id_;
/**
* string id = 1;
* @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;
}
}
/**
* string id = 1;
* @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 MESSAGE_FIELD_NUMBER = 2;
private volatile java.lang.Object message_;
/**
* string message = 2 [(.clarifai.api.utils.cl_show_if_empty) = true, (.clarifai.api.utils.cl_moretags) = "protos are cool"];
* @return The message.
*/
@java.lang.Override
public java.lang.String getMessage() {
java.lang.Object ref = message_;
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();
message_ = s;
return s;
}
}
/**
* string message = 2 [(.clarifai.api.utils.cl_show_if_empty) = true, (.clarifai.api.utils.cl_moretags) = "protos are cool"];
* @return The bytes for message.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getMessageBytes() {
java.lang.Object ref = message_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
message_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int VALUE_FIELD_NUMBER = 3;
private double value_;
/**
* double value = 3 [(.clarifai.api.utils.cl_default_float) = 1];
* @return The value.
*/
@java.lang.Override
public double getValue() {
return value_;
}
public static final int IMAGE_BYTES_FIELD_NUMBER = 4;
private com.google.protobuf.ByteString imageBytes_;
/**
* bytes image_bytes = 4;
* @return The imageBytes.
*/
@java.lang.Override
public com.google.protobuf.ByteString getImageBytes() {
return imageBytes_;
}
public static final int STRING_ONEOF_FIELD_NUMBER = 5;
/**
* string string_oneof = 5;
* @return Whether the stringOneof field is set.
*/
public boolean hasStringOneof() {
return oneOfFieldCase_ == 5;
}
/**
* string string_oneof = 5;
* @return The stringOneof.
*/
public java.lang.String getStringOneof() {
java.lang.Object ref = "";
if (oneOfFieldCase_ == 5) {
ref = oneOfField_;
}
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 (oneOfFieldCase_ == 5) {
oneOfField_ = s;
}
return s;
}
}
/**
* string string_oneof = 5;
* @return The bytes for stringOneof.
*/
public com.google.protobuf.ByteString
getStringOneofBytes() {
java.lang.Object ref = "";
if (oneOfFieldCase_ == 5) {
ref = oneOfField_;
}
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (oneOfFieldCase_ == 5) {
oneOfField_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int BOOL_ONEOF_FIELD_NUMBER = 6;
/**
* bool bool_oneof = 6;
* @return Whether the boolOneof field is set.
*/
@java.lang.Override
public boolean hasBoolOneof() {
return oneOfFieldCase_ == 6;
}
/**
* bool bool_oneof = 6;
* @return The boolOneof.
*/
@java.lang.Override
public boolean getBoolOneof() {
if (oneOfFieldCase_ == 6) {
return (java.lang.Boolean) oneOfField_;
}
return false;
}
public static final int MESSAGE_ONEOF_FIELD_NUMBER = 7;
/**
* .clarifai.api.utils.TestProto2 message_oneof = 7;
* @return Whether the messageOneof field is set.
*/
@java.lang.Override
public boolean hasMessageOneof() {
return oneOfFieldCase_ == 7;
}
/**
* .clarifai.api.utils.TestProto2 message_oneof = 7;
* @return The messageOneof.
*/
@java.lang.Override
public com.clarifai.grpc.api.utils.TestProto2 getMessageOneof() {
if (oneOfFieldCase_ == 7) {
return (com.clarifai.grpc.api.utils.TestProto2) oneOfField_;
}
return com.clarifai.grpc.api.utils.TestProto2.getDefaultInstance();
}
/**
* .clarifai.api.utils.TestProto2 message_oneof = 7;
*/
@java.lang.Override
public com.clarifai.grpc.api.utils.TestProto2OrBuilder getMessageOneofOrBuilder() {
if (oneOfFieldCase_ == 7) {
return (com.clarifai.grpc.api.utils.TestProto2) oneOfField_;
}
return com.clarifai.grpc.api.utils.TestProto2.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(message_)) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_);
}
if (java.lang.Double.doubleToRawLongBits(value_) != 0) {
output.writeDouble(3, value_);
}
if (!imageBytes_.isEmpty()) {
output.writeBytes(4, imageBytes_);
}
if (oneOfFieldCase_ == 5) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 5, oneOfField_);
}
if (oneOfFieldCase_ == 6) {
output.writeBool(
6, (boolean)((java.lang.Boolean) oneOfField_));
}
if (oneOfFieldCase_ == 7) {
output.writeMessage(7, (com.clarifai.grpc.api.utils.TestProto2) oneOfField_);
}
unknownFields.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(message_)) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, message_);
}
if (java.lang.Double.doubleToRawLongBits(value_) != 0) {
size += com.google.protobuf.CodedOutputStream
.computeDoubleSize(3, value_);
}
if (!imageBytes_.isEmpty()) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(4, imageBytes_);
}
if (oneOfFieldCase_ == 5) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, oneOfField_);
}
if (oneOfFieldCase_ == 6) {
size += com.google.protobuf.CodedOutputStream
.computeBoolSize(
6, (boolean)((java.lang.Boolean) oneOfField_));
}
if (oneOfFieldCase_ == 7) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(7, (com.clarifai.grpc.api.utils.TestProto2) oneOfField_);
}
size += unknownFields.getSerializedSize();
memoizedSize = size;
return size;
}
@java.lang.Override
public boolean equals(final java.lang.Object obj) {
if (obj == this) {
return true;
}
if (!(obj instanceof com.clarifai.grpc.api.utils.TestProto)) {
return super.equals(obj);
}
com.clarifai.grpc.api.utils.TestProto other = (com.clarifai.grpc.api.utils.TestProto) obj;
if (!getId()
.equals(other.getId())) return false;
if (!getMessage()
.equals(other.getMessage())) return false;
if (java.lang.Double.doubleToLongBits(getValue())
!= java.lang.Double.doubleToLongBits(
other.getValue())) return false;
if (!getImageBytes()
.equals(other.getImageBytes())) return false;
if (!getOneOfFieldCase().equals(other.getOneOfFieldCase())) return false;
switch (oneOfFieldCase_) {
case 5:
if (!getStringOneof()
.equals(other.getStringOneof())) return false;
break;
case 6:
if (getBoolOneof()
!= other.getBoolOneof()) return false;
break;
case 7:
if (!getMessageOneof()
.equals(other.getMessageOneof())) return false;
break;
case 0:
default:
}
if (!unknownFields.equals(other.unknownFields)) 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) + MESSAGE_FIELD_NUMBER;
hash = (53 * hash) + getMessage().hashCode();
hash = (37 * hash) + VALUE_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashLong(
java.lang.Double.doubleToLongBits(getValue()));
hash = (37 * hash) + IMAGE_BYTES_FIELD_NUMBER;
hash = (53 * hash) + getImageBytes().hashCode();
switch (oneOfFieldCase_) {
case 5:
hash = (37 * hash) + STRING_ONEOF_FIELD_NUMBER;
hash = (53 * hash) + getStringOneof().hashCode();
break;
case 6:
hash = (37 * hash) + BOOL_ONEOF_FIELD_NUMBER;
hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
getBoolOneof());
break;
case 7:
hash = (37 * hash) + MESSAGE_ONEOF_FIELD_NUMBER;
hash = (53 * hash) + getMessageOneof().hashCode();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.clarifai.grpc.api.utils.TestProto parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.utils.TestProto parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.clarifai.grpc.api.utils.TestProto parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.utils.TestProto parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.clarifai.grpc.api.utils.TestProto parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.clarifai.grpc.api.utils.TestProto parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.clarifai.grpc.api.utils.TestProto parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.utils.TestProto 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.clarifai.grpc.api.utils.TestProto parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.utils.TestProto 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.clarifai.grpc.api.utils.TestProto parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static com.clarifai.grpc.api.utils.TestProto 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.clarifai.grpc.api.utils.TestProto 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;
}
/**
* Protobuf type {@code clarifai.api.utils.TestProto}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:clarifai.api.utils.TestProto)
com.clarifai.grpc.api.utils.TestProtoOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return com.clarifai.grpc.api.utils.TestProtoOuterClass.internal_static_clarifai_api_utils_TestProto_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.clarifai.grpc.api.utils.TestProtoOuterClass.internal_static_clarifai_api_utils_TestProto_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.clarifai.grpc.api.utils.TestProto.class, com.clarifai.grpc.api.utils.TestProto.Builder.class);
}
// Construct using com.clarifai.grpc.api.utils.TestProto.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3
.alwaysUseFieldBuilders) {
}
}
@java.lang.Override
public Builder clear() {
super.clear();
id_ = "";
message_ = "";
value_ = 0D;
imageBytes_ = com.google.protobuf.ByteString.EMPTY;
oneOfFieldCase_ = 0;
oneOfField_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return com.clarifai.grpc.api.utils.TestProtoOuterClass.internal_static_clarifai_api_utils_TestProto_descriptor;
}
@java.lang.Override
public com.clarifai.grpc.api.utils.TestProto getDefaultInstanceForType() {
return com.clarifai.grpc.api.utils.TestProto.getDefaultInstance();
}
@java.lang.Override
public com.clarifai.grpc.api.utils.TestProto build() {
com.clarifai.grpc.api.utils.TestProto result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.clarifai.grpc.api.utils.TestProto buildPartial() {
com.clarifai.grpc.api.utils.TestProto result = new com.clarifai.grpc.api.utils.TestProto(this);
result.id_ = id_;
result.message_ = message_;
result.value_ = value_;
result.imageBytes_ = imageBytes_;
if (oneOfFieldCase_ == 5) {
result.oneOfField_ = oneOfField_;
}
if (oneOfFieldCase_ == 6) {
result.oneOfField_ = oneOfField_;
}
if (oneOfFieldCase_ == 7) {
if (messageOneofBuilder_ == null) {
result.oneOfField_ = oneOfField_;
} else {
result.oneOfField_ = messageOneofBuilder_.build();
}
}
result.oneOfFieldCase_ = oneOfFieldCase_;
onBuilt();
return result;
}
@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.clarifai.grpc.api.utils.TestProto) {
return mergeFrom((com.clarifai.grpc.api.utils.TestProto)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(com.clarifai.grpc.api.utils.TestProto other) {
if (other == com.clarifai.grpc.api.utils.TestProto.getDefaultInstance()) return this;
if (!other.getId().isEmpty()) {
id_ = other.id_;
onChanged();
}
if (!other.getMessage().isEmpty()) {
message_ = other.message_;
onChanged();
}
if (other.getValue() != 0D) {
setValue(other.getValue());
}
if (other.getImageBytes() != com.google.protobuf.ByteString.EMPTY) {
setImageBytes(other.getImageBytes());
}
switch (other.getOneOfFieldCase()) {
case STRING_ONEOF: {
oneOfFieldCase_ = 5;
oneOfField_ = other.oneOfField_;
onChanged();
break;
}
case BOOL_ONEOF: {
setBoolOneof(other.getBoolOneof());
break;
}
case MESSAGE_ONEOF: {
mergeMessageOneof(other.getMessageOneof());
break;
}
case ONEOFFIELD_NOT_SET: {
break;
}
}
this.mergeUnknownFields(other.unknownFields);
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 {
com.clarifai.grpc.api.utils.TestProto parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (com.clarifai.grpc.api.utils.TestProto) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int oneOfFieldCase_ = 0;
private java.lang.Object oneOfField_;
public OneOfFieldCase
getOneOfFieldCase() {
return OneOfFieldCase.forNumber(
oneOfFieldCase_);
}
public Builder clearOneOfField() {
oneOfFieldCase_ = 0;
oneOfField_ = null;
onChanged();
return this;
}
private java.lang.Object id_ = "";
/**
* string id = 1;
* @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;
}
}
/**
* string id = 1;
* @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;
}
}
/**
* string id = 1;
* @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;
onChanged();
return this;
}
/**
* string id = 1;
* @return This builder for chaining.
*/
public Builder clearId() {
id_ = getDefaultInstance().getId();
onChanged();
return this;
}
/**
* string id = 1;
* @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;
onChanged();
return this;
}
private java.lang.Object message_ = "";
/**
* string message = 2 [(.clarifai.api.utils.cl_show_if_empty) = true, (.clarifai.api.utils.cl_moretags) = "protos are cool"];
* @return The message.
*/
public java.lang.String getMessage() {
java.lang.Object ref = message_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
message_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* string message = 2 [(.clarifai.api.utils.cl_show_if_empty) = true, (.clarifai.api.utils.cl_moretags) = "protos are cool"];
* @return The bytes for message.
*/
public com.google.protobuf.ByteString
getMessageBytes() {
java.lang.Object ref = message_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
message_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* string message = 2 [(.clarifai.api.utils.cl_show_if_empty) = true, (.clarifai.api.utils.cl_moretags) = "protos are cool"];
* @param value The message to set.
* @return This builder for chaining.
*/
public Builder setMessage(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
message_ = value;
onChanged();
return this;
}
/**
* string message = 2 [(.clarifai.api.utils.cl_show_if_empty) = true, (.clarifai.api.utils.cl_moretags) = "protos are cool"];
* @return This builder for chaining.
*/
public Builder clearMessage() {
message_ = getDefaultInstance().getMessage();
onChanged();
return this;
}
/**
* string message = 2 [(.clarifai.api.utils.cl_show_if_empty) = true, (.clarifai.api.utils.cl_moretags) = "protos are cool"];
* @param value The bytes for message to set.
* @return This builder for chaining.
*/
public Builder setMessageBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
message_ = value;
onChanged();
return this;
}
private double value_ ;
/**
* double value = 3 [(.clarifai.api.utils.cl_default_float) = 1];
* @return The value.
*/
@java.lang.Override
public double getValue() {
return value_;
}
/**
* double value = 3 [(.clarifai.api.utils.cl_default_float) = 1];
* @param value The value to set.
* @return This builder for chaining.
*/
public Builder setValue(double value) {
value_ = value;
onChanged();
return this;
}
/**
* double value = 3 [(.clarifai.api.utils.cl_default_float) = 1];
* @return This builder for chaining.
*/
public Builder clearValue() {
value_ = 0D;
onChanged();
return this;
}
private com.google.protobuf.ByteString imageBytes_ = com.google.protobuf.ByteString.EMPTY;
/**
* bytes image_bytes = 4;
* @return The imageBytes.
*/
@java.lang.Override
public com.google.protobuf.ByteString getImageBytes() {
return imageBytes_;
}
/**
* bytes image_bytes = 4;
* @param value The imageBytes to set.
* @return This builder for chaining.
*/
public Builder setImageBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
imageBytes_ = value;
onChanged();
return this;
}
/**
* bytes image_bytes = 4;
* @return This builder for chaining.
*/
public Builder clearImageBytes() {
imageBytes_ = getDefaultInstance().getImageBytes();
onChanged();
return this;
}
/**
* string string_oneof = 5;
* @return Whether the stringOneof field is set.
*/
@java.lang.Override
public boolean hasStringOneof() {
return oneOfFieldCase_ == 5;
}
/**
* string string_oneof = 5;
* @return The stringOneof.
*/
@java.lang.Override
public java.lang.String getStringOneof() {
java.lang.Object ref = "";
if (oneOfFieldCase_ == 5) {
ref = oneOfField_;
}
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
if (oneOfFieldCase_ == 5) {
oneOfField_ = s;
}
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* string string_oneof = 5;
* @return The bytes for stringOneof.
*/
@java.lang.Override
public com.google.protobuf.ByteString
getStringOneofBytes() {
java.lang.Object ref = "";
if (oneOfFieldCase_ == 5) {
ref = oneOfField_;
}
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
if (oneOfFieldCase_ == 5) {
oneOfField_ = b;
}
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* string string_oneof = 5;
* @param value The stringOneof to set.
* @return This builder for chaining.
*/
public Builder setStringOneof(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
oneOfFieldCase_ = 5;
oneOfField_ = value;
onChanged();
return this;
}
/**
* string string_oneof = 5;
* @return This builder for chaining.
*/
public Builder clearStringOneof() {
if (oneOfFieldCase_ == 5) {
oneOfFieldCase_ = 0;
oneOfField_ = null;
onChanged();
}
return this;
}
/**
* string string_oneof = 5;
* @param value The bytes for stringOneof to set.
* @return This builder for chaining.
*/
public Builder setStringOneofBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
oneOfFieldCase_ = 5;
oneOfField_ = value;
onChanged();
return this;
}
/**
* bool bool_oneof = 6;
* @return Whether the boolOneof field is set.
*/
public boolean hasBoolOneof() {
return oneOfFieldCase_ == 6;
}
/**
* bool bool_oneof = 6;
* @return The boolOneof.
*/
public boolean getBoolOneof() {
if (oneOfFieldCase_ == 6) {
return (java.lang.Boolean) oneOfField_;
}
return false;
}
/**
* bool bool_oneof = 6;
* @param value The boolOneof to set.
* @return This builder for chaining.
*/
public Builder setBoolOneof(boolean value) {
oneOfFieldCase_ = 6;
oneOfField_ = value;
onChanged();
return this;
}
/**
* bool bool_oneof = 6;
* @return This builder for chaining.
*/
public Builder clearBoolOneof() {
if (oneOfFieldCase_ == 6) {
oneOfFieldCase_ = 0;
oneOfField_ = null;
onChanged();
}
return this;
}
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.utils.TestProto2, com.clarifai.grpc.api.utils.TestProto2.Builder, com.clarifai.grpc.api.utils.TestProto2OrBuilder> messageOneofBuilder_;
/**
* .clarifai.api.utils.TestProto2 message_oneof = 7;
* @return Whether the messageOneof field is set.
*/
@java.lang.Override
public boolean hasMessageOneof() {
return oneOfFieldCase_ == 7;
}
/**
* .clarifai.api.utils.TestProto2 message_oneof = 7;
* @return The messageOneof.
*/
@java.lang.Override
public com.clarifai.grpc.api.utils.TestProto2 getMessageOneof() {
if (messageOneofBuilder_ == null) {
if (oneOfFieldCase_ == 7) {
return (com.clarifai.grpc.api.utils.TestProto2) oneOfField_;
}
return com.clarifai.grpc.api.utils.TestProto2.getDefaultInstance();
} else {
if (oneOfFieldCase_ == 7) {
return messageOneofBuilder_.getMessage();
}
return com.clarifai.grpc.api.utils.TestProto2.getDefaultInstance();
}
}
/**
* .clarifai.api.utils.TestProto2 message_oneof = 7;
*/
public Builder setMessageOneof(com.clarifai.grpc.api.utils.TestProto2 value) {
if (messageOneofBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
oneOfField_ = value;
onChanged();
} else {
messageOneofBuilder_.setMessage(value);
}
oneOfFieldCase_ = 7;
return this;
}
/**
* .clarifai.api.utils.TestProto2 message_oneof = 7;
*/
public Builder setMessageOneof(
com.clarifai.grpc.api.utils.TestProto2.Builder builderForValue) {
if (messageOneofBuilder_ == null) {
oneOfField_ = builderForValue.build();
onChanged();
} else {
messageOneofBuilder_.setMessage(builderForValue.build());
}
oneOfFieldCase_ = 7;
return this;
}
/**
* .clarifai.api.utils.TestProto2 message_oneof = 7;
*/
public Builder mergeMessageOneof(com.clarifai.grpc.api.utils.TestProto2 value) {
if (messageOneofBuilder_ == null) {
if (oneOfFieldCase_ == 7 &&
oneOfField_ != com.clarifai.grpc.api.utils.TestProto2.getDefaultInstance()) {
oneOfField_ = com.clarifai.grpc.api.utils.TestProto2.newBuilder((com.clarifai.grpc.api.utils.TestProto2) oneOfField_)
.mergeFrom(value).buildPartial();
} else {
oneOfField_ = value;
}
onChanged();
} else {
if (oneOfFieldCase_ == 7) {
messageOneofBuilder_.mergeFrom(value);
} else {
messageOneofBuilder_.setMessage(value);
}
}
oneOfFieldCase_ = 7;
return this;
}
/**
* .clarifai.api.utils.TestProto2 message_oneof = 7;
*/
public Builder clearMessageOneof() {
if (messageOneofBuilder_ == null) {
if (oneOfFieldCase_ == 7) {
oneOfFieldCase_ = 0;
oneOfField_ = null;
onChanged();
}
} else {
if (oneOfFieldCase_ == 7) {
oneOfFieldCase_ = 0;
oneOfField_ = null;
}
messageOneofBuilder_.clear();
}
return this;
}
/**
* .clarifai.api.utils.TestProto2 message_oneof = 7;
*/
public com.clarifai.grpc.api.utils.TestProto2.Builder getMessageOneofBuilder() {
return getMessageOneofFieldBuilder().getBuilder();
}
/**
* .clarifai.api.utils.TestProto2 message_oneof = 7;
*/
@java.lang.Override
public com.clarifai.grpc.api.utils.TestProto2OrBuilder getMessageOneofOrBuilder() {
if ((oneOfFieldCase_ == 7) && (messageOneofBuilder_ != null)) {
return messageOneofBuilder_.getMessageOrBuilder();
} else {
if (oneOfFieldCase_ == 7) {
return (com.clarifai.grpc.api.utils.TestProto2) oneOfField_;
}
return com.clarifai.grpc.api.utils.TestProto2.getDefaultInstance();
}
}
/**
* .clarifai.api.utils.TestProto2 message_oneof = 7;
*/
private com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.utils.TestProto2, com.clarifai.grpc.api.utils.TestProto2.Builder, com.clarifai.grpc.api.utils.TestProto2OrBuilder>
getMessageOneofFieldBuilder() {
if (messageOneofBuilder_ == null) {
if (!(oneOfFieldCase_ == 7)) {
oneOfField_ = com.clarifai.grpc.api.utils.TestProto2.getDefaultInstance();
}
messageOneofBuilder_ = new com.google.protobuf.SingleFieldBuilderV3<
com.clarifai.grpc.api.utils.TestProto2, com.clarifai.grpc.api.utils.TestProto2.Builder, com.clarifai.grpc.api.utils.TestProto2OrBuilder>(
(com.clarifai.grpc.api.utils.TestProto2) oneOfField_,
getParentForChildren(),
isClean());
oneOfField_ = null;
}
oneOfFieldCase_ = 7;
onChanged();;
return messageOneofBuilder_;
}
@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:clarifai.api.utils.TestProto)
}
// @@protoc_insertion_point(class_scope:clarifai.api.utils.TestProto)
private static final com.clarifai.grpc.api.utils.TestProto DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.clarifai.grpc.api.utils.TestProto();
}
public static com.clarifai.grpc.api.utils.TestProto getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public TestProto parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new TestProto(input, extensionRegistry);
}
};
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.clarifai.grpc.api.utils.TestProto getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}