All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.apache.flink.formats.protobuf.testproto.OneofTest Maven / Gradle / Ivy
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: oneof_test.proto
package org.apache.flink.formats.protobuf.testproto;
/**
* Protobuf type {@code org.apache.flink.formats.protobuf.testproto.OneofTest}
*/
public final class OneofTest extends
com.google.protobuf.GeneratedMessageV3 implements
// @@protoc_insertion_point(message_implements:org.apache.flink.formats.protobuf.testproto.OneofTest)
OneofTestOrBuilder {
private static final long serialVersionUID = 0L;
// Use OneofTest.newBuilder() to construct.
private OneofTest(com.google.protobuf.GeneratedMessageV3.Builder builder) {
super(builder);
}
private OneofTest() {
}
@java.lang.Override
@SuppressWarnings({"unused"})
protected java.lang.Object newInstance(
UnusedPrivateParameter unused) {
return new OneofTest();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return this.unknownFields;
}
private OneofTest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 8: {
testOneofCase_ = 1;
testOneof_ = input.readInt32();
break;
}
case 16: {
testOneofCase_ = 2;
testOneof_ = input.readInt32();
break;
}
default: {
if (!parseUnknownField(
input, unknownFields, extensionRegistry, tag)) {
done = true;
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
this.unknownFields = unknownFields.build();
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.apache.flink.formats.protobuf.testproto.OneofTestOuterClass.internal_static_org_apache_flink_formats_protobuf_testproto_OneofTest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.apache.flink.formats.protobuf.testproto.OneofTestOuterClass.internal_static_org_apache_flink_formats_protobuf_testproto_OneofTest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.apache.flink.formats.protobuf.testproto.OneofTest.class, org.apache.flink.formats.protobuf.testproto.OneofTest.Builder.class);
}
private int bitField0_;
private int testOneofCase_ = 0;
private java.lang.Object testOneof_;
public enum TestOneofCase
implements com.google.protobuf.Internal.EnumLite,
com.google.protobuf.AbstractMessage.InternalOneOfEnum {
A(1),
B(2),
TESTONEOF_NOT_SET(0);
private final int value;
private TestOneofCase(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 TestOneofCase valueOf(int value) {
return forNumber(value);
}
public static TestOneofCase forNumber(int value) {
switch (value) {
case 1: return A;
case 2: return B;
case 0: return TESTONEOF_NOT_SET;
default: return null;
}
}
public int getNumber() {
return this.value;
}
};
public TestOneofCase
getTestOneofCase() {
return TestOneofCase.forNumber(
testOneofCase_);
}
public static final int A_FIELD_NUMBER = 1;
/**
* optional int32 a = 1;
* @return Whether the a field is set.
*/
public boolean hasA() {
return testOneofCase_ == 1;
}
/**
* optional int32 a = 1;
* @return The a.
*/
public int getA() {
if (testOneofCase_ == 1) {
return (java.lang.Integer) testOneof_;
}
return 0;
}
public static final int B_FIELD_NUMBER = 2;
/**
* optional int32 b = 2;
* @return Whether the b field is set.
*/
public boolean hasB() {
return testOneofCase_ == 2;
}
/**
* optional int32 b = 2;
* @return The b.
*/
public int getB() {
if (testOneofCase_ == 2) {
return (java.lang.Integer) testOneof_;
}
return 0;
}
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 (testOneofCase_ == 1) {
output.writeInt32(
1, (int)((java.lang.Integer) testOneof_));
}
if (testOneofCase_ == 2) {
output.writeInt32(
2, (int)((java.lang.Integer) testOneof_));
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (testOneofCase_ == 1) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(
1, (int)((java.lang.Integer) testOneof_));
}
if (testOneofCase_ == 2) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(
2, (int)((java.lang.Integer) testOneof_));
}
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 org.apache.flink.formats.protobuf.testproto.OneofTest)) {
return super.equals(obj);
}
org.apache.flink.formats.protobuf.testproto.OneofTest other = (org.apache.flink.formats.protobuf.testproto.OneofTest) obj;
if (!getTestOneofCase().equals(other.getTestOneofCase())) return false;
switch (testOneofCase_) {
case 1:
if (getA()
!= other.getA()) return false;
break;
case 2:
if (getB()
!= other.getB()) 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();
switch (testOneofCase_) {
case 1:
hash = (37 * hash) + A_FIELD_NUMBER;
hash = (53 * hash) + getA();
break;
case 2:
hash = (37 * hash) + B_FIELD_NUMBER;
hash = (53 * hash) + getB();
break;
case 0:
default:
}
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static org.apache.flink.formats.protobuf.testproto.OneofTest parseFrom(
java.nio.ByteBuffer data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.apache.flink.formats.protobuf.testproto.OneofTest parseFrom(
java.nio.ByteBuffer data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.apache.flink.formats.protobuf.testproto.OneofTest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.apache.flink.formats.protobuf.testproto.OneofTest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.apache.flink.formats.protobuf.testproto.OneofTest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static org.apache.flink.formats.protobuf.testproto.OneofTest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static org.apache.flink.formats.protobuf.testproto.OneofTest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.apache.flink.formats.protobuf.testproto.OneofTest 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 org.apache.flink.formats.protobuf.testproto.OneofTest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseDelimitedWithIOException(PARSER, input);
}
public static org.apache.flink.formats.protobuf.testproto.OneofTest 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 org.apache.flink.formats.protobuf.testproto.OneofTest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3
.parseWithIOException(PARSER, input);
}
public static org.apache.flink.formats.protobuf.testproto.OneofTest 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(org.apache.flink.formats.protobuf.testproto.OneofTest 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 org.apache.flink.formats.protobuf.testproto.OneofTest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessageV3.Builder implements
// @@protoc_insertion_point(builder_implements:org.apache.flink.formats.protobuf.testproto.OneofTest)
org.apache.flink.formats.protobuf.testproto.OneofTestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return org.apache.flink.formats.protobuf.testproto.OneofTestOuterClass.internal_static_org_apache_flink_formats_protobuf_testproto_OneofTest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return org.apache.flink.formats.protobuf.testproto.OneofTestOuterClass.internal_static_org_apache_flink_formats_protobuf_testproto_OneofTest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
org.apache.flink.formats.protobuf.testproto.OneofTest.class, org.apache.flink.formats.protobuf.testproto.OneofTest.Builder.class);
}
// Construct using org.apache.flink.formats.protobuf.testproto.OneofTest.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();
testOneofCase_ = 0;
testOneof_ = null;
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return org.apache.flink.formats.protobuf.testproto.OneofTestOuterClass.internal_static_org_apache_flink_formats_protobuf_testproto_OneofTest_descriptor;
}
@java.lang.Override
public org.apache.flink.formats.protobuf.testproto.OneofTest getDefaultInstanceForType() {
return org.apache.flink.formats.protobuf.testproto.OneofTest.getDefaultInstance();
}
@java.lang.Override
public org.apache.flink.formats.protobuf.testproto.OneofTest build() {
org.apache.flink.formats.protobuf.testproto.OneofTest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public org.apache.flink.formats.protobuf.testproto.OneofTest buildPartial() {
org.apache.flink.formats.protobuf.testproto.OneofTest result = new org.apache.flink.formats.protobuf.testproto.OneofTest(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (testOneofCase_ == 1) {
result.testOneof_ = testOneof_;
}
if (testOneofCase_ == 2) {
result.testOneof_ = testOneof_;
}
result.bitField0_ = to_bitField0_;
result.testOneofCase_ = testOneofCase_;
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 org.apache.flink.formats.protobuf.testproto.OneofTest) {
return mergeFrom((org.apache.flink.formats.protobuf.testproto.OneofTest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(org.apache.flink.formats.protobuf.testproto.OneofTest other) {
if (other == org.apache.flink.formats.protobuf.testproto.OneofTest.getDefaultInstance()) return this;
switch (other.getTestOneofCase()) {
case A: {
setA(other.getA());
break;
}
case B: {
setB(other.getB());
break;
}
case TESTONEOF_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 {
org.apache.flink.formats.protobuf.testproto.OneofTest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (org.apache.flink.formats.protobuf.testproto.OneofTest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int testOneofCase_ = 0;
private java.lang.Object testOneof_;
public TestOneofCase
getTestOneofCase() {
return TestOneofCase.forNumber(
testOneofCase_);
}
public Builder clearTestOneof() {
testOneofCase_ = 0;
testOneof_ = null;
onChanged();
return this;
}
private int bitField0_;
/**
* optional int32 a = 1;
* @return Whether the a field is set.
*/
public boolean hasA() {
return testOneofCase_ == 1;
}
/**
* optional int32 a = 1;
* @return The a.
*/
public int getA() {
if (testOneofCase_ == 1) {
return (java.lang.Integer) testOneof_;
}
return 0;
}
/**
* optional int32 a = 1;
* @param value The a to set.
* @return This builder for chaining.
*/
public Builder setA(int value) {
testOneofCase_ = 1;
testOneof_ = value;
onChanged();
return this;
}
/**
* optional int32 a = 1;
* @return This builder for chaining.
*/
public Builder clearA() {
if (testOneofCase_ == 1) {
testOneofCase_ = 0;
testOneof_ = null;
onChanged();
}
return this;
}
/**
* optional int32 b = 2;
* @return Whether the b field is set.
*/
public boolean hasB() {
return testOneofCase_ == 2;
}
/**
* optional int32 b = 2;
* @return The b.
*/
public int getB() {
if (testOneofCase_ == 2) {
return (java.lang.Integer) testOneof_;
}
return 0;
}
/**
* optional int32 b = 2;
* @param value The b to set.
* @return This builder for chaining.
*/
public Builder setB(int value) {
testOneofCase_ = 2;
testOneof_ = value;
onChanged();
return this;
}
/**
* optional int32 b = 2;
* @return This builder for chaining.
*/
public Builder clearB() {
if (testOneofCase_ == 2) {
testOneofCase_ = 0;
testOneof_ = null;
onChanged();
}
return this;
}
@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:org.apache.flink.formats.protobuf.testproto.OneofTest)
}
// @@protoc_insertion_point(class_scope:org.apache.flink.formats.protobuf.testproto.OneofTest)
private static final org.apache.flink.formats.protobuf.testproto.OneofTest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new org.apache.flink.formats.protobuf.testproto.OneofTest();
}
public static org.apache.flink.formats.protobuf.testproto.OneofTest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
@java.lang.Deprecated public static final com.google.protobuf.Parser
PARSER = new com.google.protobuf.AbstractParser() {
@java.lang.Override
public OneofTest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new OneofTest(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 org.apache.flink.formats.protobuf.testproto.OneofTest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}