diff --git a/lang/java/pom.xml b/lang/java/pom.xml index f2a9d44b3e2..21b298436cb 100644 --- a/lang/java/pom.xml +++ b/lang/java/pom.xml @@ -52,7 +52,7 @@ 3.9.6 5.11.0 4.1.109.Final - 3.25.3 + 4.26.1 1.2.25 4.0.1 2.0.13 diff --git a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/A.java b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/A.java index 20633d5b7df..bbf96bce7c7 100644 --- a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/A.java +++ b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/A.java @@ -1,6 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: src/test/protobuf/test_multiple_files.proto +// Protobuf Java Version: 4.26.1 package org.apache.avro.protobuf.multiplefiles; /** @@ -24,6 +25,11 @@ public enum A implements com.google.protobuf.ProtocolMessageEnum { */ Z(3),; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */ 4, /* minor= */ 26, /* patch= */ 1, + /* suffix= */ "", A.class.getName()); + } /** * X = 1; */ @@ -42,6 +48,8 @@ public final int getNumber() { } /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated @@ -49,6 +57,10 @@ public static A valueOf(int value) { return forNumber(value); } + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ public static A forNumber(int value) { switch (value) { case 1: diff --git a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/Foo.java b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/Foo.java index b7289422987..39b521d2c23 100644 --- a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/Foo.java +++ b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/Foo.java @@ -1,275 +1,42 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: src/test/protobuf/test_multiple_files.proto +// Protobuf Java Version: 4.26.1 package org.apache.avro.protobuf.multiplefiles; /** * Protobuf type {@code org.apache.avro.protobuf.multiplefiles.Foo} */ -public final class Foo extends com.google.protobuf.GeneratedMessageV3 implements +public final class Foo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:org.apache.avro.protobuf.multiplefiles.Foo) FooOrBuilder { private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */ 4, /* minor= */ 26, /* patch= */ 1, + /* suffix= */ "", Foo.class.getName()); + } // Use Foo.newBuilder() to construct. - private Foo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Foo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Foo() { - int32_ = 0; - int64_ = 0L; - uint32_ = 0; - uint64_ = 0L; - sint32_ = 0; - sint64_ = 0L; - fixed32_ = 0; - fixed64_ = 0L; - sfixed32_ = 0; - sfixed64_ = 0L; - float_ = 0F; - double_ = 0D; - bool_ = false; string_ = ""; bytes_ = com.google.protobuf.ByteString.EMPTY; enum_ = 3; - intArray_ = java.util.Collections.emptyList(); + intArray_ = emptyIntList(); fooArray_ = java.util.Collections.emptyList(); syms_ = java.util.Collections.emptyList(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Foo(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: { - bitField0_ |= 0x00000001; - int32_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - int64_ = input.readInt64(); - break; - } - case 24: { - bitField0_ |= 0x00000004; - uint32_ = input.readUInt32(); - break; - } - case 32: { - bitField0_ |= 0x00000008; - uint64_ = input.readUInt64(); - break; - } - case 40: { - bitField0_ |= 0x00000010; - sint32_ = input.readSInt32(); - break; - } - case 48: { - bitField0_ |= 0x00000020; - sint64_ = input.readSInt64(); - break; - } - case 61: { - bitField0_ |= 0x00000040; - fixed32_ = input.readFixed32(); - break; - } - case 65: { - bitField0_ |= 0x00000080; - fixed64_ = input.readFixed64(); - break; - } - case 77: { - bitField0_ |= 0x00000100; - sfixed32_ = input.readSFixed32(); - break; - } - case 81: { - bitField0_ |= 0x00000200; - sfixed64_ = input.readSFixed64(); - break; - } - case 93: { - bitField0_ |= 0x00000400; - float_ = input.readFloat(); - break; - } - case 97: { - bitField0_ |= 0x00000800; - double_ = input.readDouble(); - break; - } - case 104: { - bitField0_ |= 0x00001000; - bool_ = input.readBool(); - break; - } - case 114: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00002000; - string_ = bs; - break; - } - case 122: { - bitField0_ |= 0x00004000; - bytes_ = input.readBytes(); - break; - } - case 128: { - int rawValue = input.readEnum(); - @SuppressWarnings("deprecation") - org.apache.avro.protobuf.multiplefiles.A value = org.apache.avro.protobuf.multiplefiles.A.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(16, rawValue); - } else { - bitField0_ |= 0x00008000; - enum_ = rawValue; - } - break; - } - case 136: { - if (!((mutable_bitField0_ & 0x00010000) == 0x00010000)) { - intArray_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00010000; - } - intArray_.add(input.readInt32()); - break; - } - case 138: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00010000) == 0x00010000) && input.getBytesUntilLimit() > 0) { - intArray_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00010000; - } - while (input.getBytesUntilLimit() > 0) { - intArray_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 146: { - org.apache.avro.protobuf.multiplefiles.Foo.Builder subBuilder = null; - if (((bitField0_ & 0x00010000) == 0x00010000)) { - subBuilder = foo_.toBuilder(); - } - foo_ = input.readMessage(org.apache.avro.protobuf.multiplefiles.Foo.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(foo_); - foo_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00010000; - break; - } - case 152: { - int rawValue = input.readEnum(); - @SuppressWarnings("deprecation") - org.apache.avro.protobuf.multiplefiles.A value = org.apache.avro.protobuf.multiplefiles.A.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(19, rawValue); - } else { - if (!((mutable_bitField0_ & 0x00040000) == 0x00040000)) { - syms_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00040000; - } - syms_.add(rawValue); - } - break; - } - case 154: { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while (input.getBytesUntilLimit() > 0) { - int rawValue = input.readEnum(); - @SuppressWarnings("deprecation") - org.apache.avro.protobuf.multiplefiles.A value = org.apache.avro.protobuf.multiplefiles.A.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(19, rawValue); - } else { - if (!((mutable_bitField0_ & 0x00040000) == 0x00040000)) { - syms_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00040000; - } - syms_.add(rawValue); - } - } - input.popLimit(oldLimit); - break; - } - case 162: { - if (!((mutable_bitField0_ & 0x00020000) == 0x00020000)) { - fooArray_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00020000; - } - fooArray_.add(input.readMessage(org.apache.avro.protobuf.multiplefiles.Foo.PARSER, extensionRegistry)); - break; - } - case 170: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (((bitField0_ & 0x00020000) == 0x00020000)) { - subBuilder = timestamp_.toBuilder(); - } - timestamp_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(timestamp_); - timestamp_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00020000; - 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 { - if (((mutable_bitField0_ & 0x00010000) == 0x00010000)) { - intArray_ = java.util.Collections.unmodifiableList(intArray_); - } - if (((mutable_bitField0_ & 0x00040000) == 0x00040000)) { - syms_ = java.util.Collections.unmodifiableList(syms_); - } - if (((mutable_bitField0_ & 0x00020000) == 0x00020000)) { - fooArray_ = java.util.Collections.unmodifiableList(fooArray_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_Foo_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_Foo_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.multiplefiles.Foo.class, org.apache.avro.protobuf.multiplefiles.Foo.Builder.class); @@ -277,7 +44,7 @@ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetF private int bitField0_; public static final int INT32_FIELD_NUMBER = 1; - private int int32_; + private int int32_ = 0; /** *
@@ -285,9 +52,12 @@ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetF
    * 
* * required int32 int32 = 1; + * + * @return Whether the int32 field is set. */ + @java.lang.Override public boolean hasInt32() { - return ((bitField0_ & 0x00000001) == 0x00000001); + return ((bitField0_ & 0x00000001) != 0); } /** @@ -296,228 +66,310 @@ public boolean hasInt32() { * * * required int32 int32 = 1; + * + * @return The int32. */ + @java.lang.Override public int getInt32() { return int32_; } public static final int INT64_FIELD_NUMBER = 2; - private long int64_; + private long int64_ = 0L; /** * optional int64 int64 = 2; + * + * @return Whether the int64 field is set. */ + @java.lang.Override public boolean hasInt64() { - return ((bitField0_ & 0x00000002) == 0x00000002); + return ((bitField0_ & 0x00000002) != 0); } /** * optional int64 int64 = 2; + * + * @return The int64. */ + @java.lang.Override public long getInt64() { return int64_; } public static final int UINT32_FIELD_NUMBER = 3; - private int uint32_; + private int uint32_ = 0; /** * optional uint32 uint32 = 3; + * + * @return Whether the uint32 field is set. */ + @java.lang.Override public boolean hasUint32() { - return ((bitField0_ & 0x00000004) == 0x00000004); + return ((bitField0_ & 0x00000004) != 0); } /** * optional uint32 uint32 = 3; + * + * @return The uint32. */ + @java.lang.Override public int getUint32() { return uint32_; } public static final int UINT64_FIELD_NUMBER = 4; - private long uint64_; + private long uint64_ = 0L; /** * optional uint64 uint64 = 4; + * + * @return Whether the uint64 field is set. */ + @java.lang.Override public boolean hasUint64() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000008) != 0); } /** * optional uint64 uint64 = 4; + * + * @return The uint64. */ + @java.lang.Override public long getUint64() { return uint64_; } public static final int SINT32_FIELD_NUMBER = 5; - private int sint32_; + private int sint32_ = 0; /** * optional sint32 sint32 = 5; + * + * @return Whether the sint32 field is set. */ + @java.lang.Override public boolean hasSint32() { - return ((bitField0_ & 0x00000010) == 0x00000010); + return ((bitField0_ & 0x00000010) != 0); } /** * optional sint32 sint32 = 5; + * + * @return The sint32. */ + @java.lang.Override public int getSint32() { return sint32_; } public static final int SINT64_FIELD_NUMBER = 6; - private long sint64_; + private long sint64_ = 0L; /** * optional sint64 sint64 = 6; + * + * @return Whether the sint64 field is set. */ + @java.lang.Override public boolean hasSint64() { - return ((bitField0_ & 0x00000020) == 0x00000020); + return ((bitField0_ & 0x00000020) != 0); } /** * optional sint64 sint64 = 6; + * + * @return The sint64. */ + @java.lang.Override public long getSint64() { return sint64_; } public static final int FIXED32_FIELD_NUMBER = 7; - private int fixed32_; + private int fixed32_ = 0; /** * optional fixed32 fixed32 = 7; + * + * @return Whether the fixed32 field is set. */ + @java.lang.Override public boolean hasFixed32() { - return ((bitField0_ & 0x00000040) == 0x00000040); + return ((bitField0_ & 0x00000040) != 0); } /** * optional fixed32 fixed32 = 7; + * + * @return The fixed32. */ + @java.lang.Override public int getFixed32() { return fixed32_; } public static final int FIXED64_FIELD_NUMBER = 8; - private long fixed64_; + private long fixed64_ = 0L; /** * optional fixed64 fixed64 = 8; + * + * @return Whether the fixed64 field is set. */ + @java.lang.Override public boolean hasFixed64() { - return ((bitField0_ & 0x00000080) == 0x00000080); + return ((bitField0_ & 0x00000080) != 0); } /** * optional fixed64 fixed64 = 8; + * + * @return The fixed64. */ + @java.lang.Override public long getFixed64() { return fixed64_; } public static final int SFIXED32_FIELD_NUMBER = 9; - private int sfixed32_; + private int sfixed32_ = 0; /** * optional sfixed32 sfixed32 = 9; + * + * @return Whether the sfixed32 field is set. */ + @java.lang.Override public boolean hasSfixed32() { - return ((bitField0_ & 0x00000100) == 0x00000100); + return ((bitField0_ & 0x00000100) != 0); } /** * optional sfixed32 sfixed32 = 9; + * + * @return The sfixed32. */ + @java.lang.Override public int getSfixed32() { return sfixed32_; } public static final int SFIXED64_FIELD_NUMBER = 10; - private long sfixed64_; + private long sfixed64_ = 0L; /** * optional sfixed64 sfixed64 = 10; + * + * @return Whether the sfixed64 field is set. */ + @java.lang.Override public boolean hasSfixed64() { - return ((bitField0_ & 0x00000200) == 0x00000200); + return ((bitField0_ & 0x00000200) != 0); } /** * optional sfixed64 sfixed64 = 10; + * + * @return The sfixed64. */ + @java.lang.Override public long getSfixed64() { return sfixed64_; } public static final int FLOAT_FIELD_NUMBER = 11; - private float float_; + private float float_ = 0F; /** * optional float float = 11; + * + * @return Whether the float field is set. */ + @java.lang.Override public boolean hasFloat() { - return ((bitField0_ & 0x00000400) == 0x00000400); + return ((bitField0_ & 0x00000400) != 0); } /** * optional float float = 11; + * + * @return The float. */ + @java.lang.Override public float getFloat() { return float_; } public static final int DOUBLE_FIELD_NUMBER = 12; - private double double_; + private double double_ = 0D; /** * optional double double = 12; + * + * @return Whether the double field is set. */ + @java.lang.Override public boolean hasDouble() { - return ((bitField0_ & 0x00000800) == 0x00000800); + return ((bitField0_ & 0x00000800) != 0); } /** * optional double double = 12; + * + * @return The double. */ + @java.lang.Override public double getDouble() { return double_; } public static final int BOOL_FIELD_NUMBER = 13; - private boolean bool_; + private boolean bool_ = false; /** * optional bool bool = 13; + * + * @return Whether the bool field is set. */ + @java.lang.Override public boolean hasBool() { - return ((bitField0_ & 0x00001000) == 0x00001000); + return ((bitField0_ & 0x00001000) != 0); } /** * optional bool bool = 13; + * + * @return The bool. */ + @java.lang.Override public boolean getBool() { return bool_; } public static final int STRING_FIELD_NUMBER = 14; - private volatile java.lang.Object string_; + @SuppressWarnings("serial") + private volatile java.lang.Object string_ = ""; /** * optional string string = 14; + * + * @return Whether the string field is set. */ + @java.lang.Override public boolean hasString() { - return ((bitField0_ & 0x00002000) == 0x00002000); + return ((bitField0_ & 0x00002000) != 0); } /** * optional string string = 14; + * + * @return The string. */ + @java.lang.Override public java.lang.String getString() { java.lang.Object ref = string_; if (ref instanceof java.lang.String) { @@ -534,7 +386,10 @@ public java.lang.String getString() { /** * optional string string = 14; + * + * @return The bytes for string. */ + @java.lang.Override public com.google.protobuf.ByteString getStringBytes() { java.lang.Object ref = string_; if (ref instanceof java.lang.String) { @@ -547,43 +402,55 @@ public com.google.protobuf.ByteString getStringBytes() { } public static final int BYTES_FIELD_NUMBER = 15; - private com.google.protobuf.ByteString bytes_; + private com.google.protobuf.ByteString bytes_ = com.google.protobuf.ByteString.EMPTY; /** * optional bytes bytes = 15; + * + * @return Whether the bytes field is set. */ + @java.lang.Override public boolean hasBytes() { - return ((bitField0_ & 0x00004000) == 0x00004000); + return ((bitField0_ & 0x00004000) != 0); } /** * optional bytes bytes = 15; + * + * @return The bytes. */ + @java.lang.Override public com.google.protobuf.ByteString getBytes() { return bytes_; } public static final int ENUM_FIELD_NUMBER = 16; - private int enum_; + private int enum_ = 3; /** * optional .org.apache.avro.protobuf.multiplefiles.A enum = 16 [default = Z]; + * + * @return Whether the enum field is set. */ + @java.lang.Override public boolean hasEnum() { - return ((bitField0_ & 0x00008000) == 0x00008000); + return ((bitField0_ & 0x00008000) != 0); } /** * optional .org.apache.avro.protobuf.multiplefiles.A enum = 16 [default = Z]; + * + * @return The enum. */ + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.A getEnum() { - @SuppressWarnings("deprecation") - org.apache.avro.protobuf.multiplefiles.A result = org.apache.avro.protobuf.multiplefiles.A.valueOf(enum_); + org.apache.avro.protobuf.multiplefiles.A result = org.apache.avro.protobuf.multiplefiles.A.forNumber(enum_); return result == null ? org.apache.avro.protobuf.multiplefiles.A.Z : result; } public static final int INTARRAY_FIELD_NUMBER = 17; - private java.util.List intArray_; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList intArray_ = emptyIntList(); /** *
@@ -591,7 +458,10 @@ public org.apache.avro.protobuf.multiplefiles.A getEnum() {
    * 
* * repeated int32 intArray = 17; + * + * @return A list containing the intArray. */ + @java.lang.Override public java.util.List getIntArrayList() { return intArray_; } @@ -602,6 +472,8 @@ public java.util.List getIntArrayList() { * * * repeated int32 intArray = 17; + * + * @return The count of intArray. */ public int getIntArrayCount() { return intArray_.size(); @@ -613,17 +485,22 @@ public int getIntArrayCount() { * * * repeated int32 intArray = 17; + * + * @param index The index of the element to return. + * @return The intArray at the given index. */ public int getIntArray(int index) { - return intArray_.get(index); + return intArray_.getInt(index); } public static final int FOOARRAY_FIELD_NUMBER = 20; + @SuppressWarnings("serial") private java.util.List fooArray_; /** * repeated .org.apache.avro.protobuf.multiplefiles.Foo fooArray = 20; */ + @java.lang.Override public java.util.List getFooArrayList() { return fooArray_; } @@ -631,6 +508,7 @@ public java.util.List getFooArrayLis /** * repeated .org.apache.avro.protobuf.multiplefiles.Foo fooArray = 20; */ + @java.lang.Override public java.util.List getFooArrayOrBuilderList() { return fooArray_; } @@ -638,6 +516,7 @@ public java.util.Listrepeated .org.apache.avro.protobuf.multiplefiles.Foo fooArray = 20; */ + @java.lang.Override public int getFooArrayCount() { return fooArray_.size(); } @@ -645,6 +524,7 @@ public int getFooArrayCount() { /** * repeated .org.apache.avro.protobuf.multiplefiles.Foo fooArray = 20; */ + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.Foo getFooArray(int index) { return fooArray_.get(index); } @@ -652,23 +532,27 @@ public org.apache.avro.protobuf.multiplefiles.Foo getFooArray(int index) { /** * repeated .org.apache.avro.protobuf.multiplefiles.Foo fooArray = 20; */ + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.FooOrBuilder getFooArrayOrBuilder(int index) { return fooArray_.get(index); } public static final int SYMS_FIELD_NUMBER = 19; + @SuppressWarnings("serial") private java.util.List syms_; private static final com.google.protobuf.Internal.ListAdapter.Converter syms_converter_ = new com.google.protobuf.Internal.ListAdapter.Converter() { public org.apache.avro.protobuf.multiplefiles.A convert(java.lang.Integer from) { - @SuppressWarnings("deprecation") - org.apache.avro.protobuf.multiplefiles.A result = org.apache.avro.protobuf.multiplefiles.A.valueOf(from); + org.apache.avro.protobuf.multiplefiles.A result = org.apache.avro.protobuf.multiplefiles.A.forNumber(from); return result == null ? org.apache.avro.protobuf.multiplefiles.A.X : result; } }; /** * repeated .org.apache.avro.protobuf.multiplefiles.A syms = 19; + * + * @return A list containing the syms. */ + @java.lang.Override public java.util.List getSymsList() { return new com.google.protobuf.Internal.ListAdapter( syms_, syms_converter_); @@ -676,14 +560,21 @@ public java.util.List getSymsList() { /** * repeated .org.apache.avro.protobuf.multiplefiles.A syms = 19; + * + * @return The count of syms. */ + @java.lang.Override public int getSymsCount() { return syms_.size(); } /** * repeated .org.apache.avro.protobuf.multiplefiles.A syms = 19; + * + * @param index The index of the element to return. + * @return The syms at the given index. */ + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.A getSyms(int index) { return syms_converter_.convert(syms_.get(index)); } @@ -697,9 +588,12 @@ public org.apache.avro.protobuf.multiplefiles.A getSyms(int index) { * * * optional .org.apache.avro.protobuf.multiplefiles.Foo foo = 18; + * + * @return Whether the foo field is set. */ + @java.lang.Override public boolean hasFoo() { - return ((bitField0_ & 0x00010000) == 0x00010000); + return ((bitField0_ & 0x00010000) != 0); } /** @@ -708,7 +602,10 @@ public boolean hasFoo() { * * * optional .org.apache.avro.protobuf.multiplefiles.Foo foo = 18; + * + * @return The foo. */ + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.Foo getFoo() { return foo_ == null ? org.apache.avro.protobuf.multiplefiles.Foo.getDefaultInstance() : foo_; } @@ -720,6 +617,7 @@ public org.apache.avro.protobuf.multiplefiles.Foo getFoo() { * * optional .org.apache.avro.protobuf.multiplefiles.Foo foo = 18; */ + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.FooOrBuilder getFooOrBuilder() { return foo_ == null ? org.apache.avro.protobuf.multiplefiles.Foo.getDefaultInstance() : foo_; } @@ -733,9 +631,12 @@ public org.apache.avro.protobuf.multiplefiles.FooOrBuilder getFooOrBuilder() { * * * optional .google.protobuf.Timestamp timestamp = 21; + * + * @return Whether the timestamp field is set. */ + @java.lang.Override public boolean hasTimestamp() { - return ((bitField0_ & 0x00020000) == 0x00020000); + return ((bitField0_ & 0x00020000) != 0); } /** @@ -744,7 +645,10 @@ public boolean hasTimestamp() { * * * optional .google.protobuf.Timestamp timestamp = 21; + * + * @return The timestamp. */ + @java.lang.Override public com.google.protobuf.Timestamp getTimestamp() { return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; } @@ -756,6 +660,7 @@ public com.google.protobuf.Timestamp getTimestamp() { * * optional .google.protobuf.Timestamp timestamp = 21; */ + @java.lang.Override public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; } @@ -792,58 +697,58 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeInt32(1, int32_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeInt64(2, int64_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeUInt32(3, uint32_); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (((bitField0_ & 0x00000008) != 0)) { output.writeUInt64(4, uint64_); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (((bitField0_ & 0x00000010) != 0)) { output.writeSInt32(5, sint32_); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { + if (((bitField0_ & 0x00000020) != 0)) { output.writeSInt64(6, sint64_); } - if (((bitField0_ & 0x00000040) == 0x00000040)) { + if (((bitField0_ & 0x00000040) != 0)) { output.writeFixed32(7, fixed32_); } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (((bitField0_ & 0x00000080) != 0)) { output.writeFixed64(8, fixed64_); } - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (((bitField0_ & 0x00000100) != 0)) { output.writeSFixed32(9, sfixed32_); } - if (((bitField0_ & 0x00000200) == 0x00000200)) { + if (((bitField0_ & 0x00000200) != 0)) { output.writeSFixed64(10, sfixed64_); } - if (((bitField0_ & 0x00000400) == 0x00000400)) { + if (((bitField0_ & 0x00000400) != 0)) { output.writeFloat(11, float_); } - if (((bitField0_ & 0x00000800) == 0x00000800)) { + if (((bitField0_ & 0x00000800) != 0)) { output.writeDouble(12, double_); } - if (((bitField0_ & 0x00001000) == 0x00001000)) { + if (((bitField0_ & 0x00001000) != 0)) { output.writeBool(13, bool_); } - if (((bitField0_ & 0x00002000) == 0x00002000)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 14, string_); + if (((bitField0_ & 0x00002000) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 14, string_); } - if (((bitField0_ & 0x00004000) == 0x00004000)) { + if (((bitField0_ & 0x00004000) != 0)) { output.writeBytes(15, bytes_); } - if (((bitField0_ & 0x00008000) == 0x00008000)) { + if (((bitField0_ & 0x00008000) != 0)) { output.writeEnum(16, enum_); } for (int i = 0; i < intArray_.size(); i++) { - output.writeInt32(17, intArray_.get(i)); + output.writeInt32(17, intArray_.getInt(i)); } - if (((bitField0_ & 0x00010000) == 0x00010000)) { + if (((bitField0_ & 0x00010000) != 0)) { output.writeMessage(18, getFoo()); } for (int i = 0; i < syms_.size(); i++) { @@ -852,10 +757,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < fooArray_.size(); i++) { output.writeMessage(20, fooArray_.get(i)); } - if (((bitField0_ & 0x00020000) == 0x00020000)) { + if (((bitField0_ & 0x00020000) != 0)) { output.writeMessage(21, getTimestamp()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -865,63 +770,63 @@ public int getSerializedSize() { return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, int32_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, int64_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeUInt32Size(3, uint32_); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream.computeUInt64Size(4, uint64_); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (((bitField0_ & 0x00000010) != 0)) { size += com.google.protobuf.CodedOutputStream.computeSInt32Size(5, sint32_); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { + if (((bitField0_ & 0x00000020) != 0)) { size += com.google.protobuf.CodedOutputStream.computeSInt64Size(6, sint64_); } - if (((bitField0_ & 0x00000040) == 0x00000040)) { + if (((bitField0_ & 0x00000040) != 0)) { size += com.google.protobuf.CodedOutputStream.computeFixed32Size(7, fixed32_); } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (((bitField0_ & 0x00000080) != 0)) { size += com.google.protobuf.CodedOutputStream.computeFixed64Size(8, fixed64_); } - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (((bitField0_ & 0x00000100) != 0)) { size += com.google.protobuf.CodedOutputStream.computeSFixed32Size(9, sfixed32_); } - if (((bitField0_ & 0x00000200) == 0x00000200)) { + if (((bitField0_ & 0x00000200) != 0)) { size += com.google.protobuf.CodedOutputStream.computeSFixed64Size(10, sfixed64_); } - if (((bitField0_ & 0x00000400) == 0x00000400)) { + if (((bitField0_ & 0x00000400) != 0)) { size += com.google.protobuf.CodedOutputStream.computeFloatSize(11, float_); } - if (((bitField0_ & 0x00000800) == 0x00000800)) { + if (((bitField0_ & 0x00000800) != 0)) { size += com.google.protobuf.CodedOutputStream.computeDoubleSize(12, double_); } - if (((bitField0_ & 0x00001000) == 0x00001000)) { + if (((bitField0_ & 0x00001000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, bool_); } - if (((bitField0_ & 0x00002000) == 0x00002000)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, string_); + if (((bitField0_ & 0x00002000) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(14, string_); } - if (((bitField0_ & 0x00004000) == 0x00004000)) { + if (((bitField0_ & 0x00004000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(15, bytes_); } - if (((bitField0_ & 0x00008000) == 0x00008000)) { + if (((bitField0_ & 0x00008000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(16, enum_); } { int dataSize = 0; for (int i = 0; i < intArray_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(intArray_.get(i)); + dataSize += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(intArray_.getInt(i)); } size += dataSize; size += 2 * getIntArrayList().size(); } - if (((bitField0_ & 0x00010000) == 0x00010000)) { + if (((bitField0_ & 0x00010000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getFoo()); } { @@ -935,10 +840,10 @@ public int getSerializedSize() { for (int i = 0; i < fooArray_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, fooArray_.get(i)); } - if (((bitField0_ & 0x00020000) == 0x00020000)) { + if (((bitField0_ & 0x00020000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getTimestamp()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -953,86 +858,123 @@ public boolean equals(final java.lang.Object obj) { } org.apache.avro.protobuf.multiplefiles.Foo other = (org.apache.avro.protobuf.multiplefiles.Foo) obj; - boolean result = true; - result = result && (hasInt32() == other.hasInt32()); + if (hasInt32() != other.hasInt32()) + return false; if (hasInt32()) { - result = result && (getInt32() == other.getInt32()); + if (getInt32() != other.getInt32()) + return false; } - result = result && (hasInt64() == other.hasInt64()); + if (hasInt64() != other.hasInt64()) + return false; if (hasInt64()) { - result = result && (getInt64() == other.getInt64()); + if (getInt64() != other.getInt64()) + return false; } - result = result && (hasUint32() == other.hasUint32()); + if (hasUint32() != other.hasUint32()) + return false; if (hasUint32()) { - result = result && (getUint32() == other.getUint32()); + if (getUint32() != other.getUint32()) + return false; } - result = result && (hasUint64() == other.hasUint64()); + if (hasUint64() != other.hasUint64()) + return false; if (hasUint64()) { - result = result && (getUint64() == other.getUint64()); + if (getUint64() != other.getUint64()) + return false; } - result = result && (hasSint32() == other.hasSint32()); + if (hasSint32() != other.hasSint32()) + return false; if (hasSint32()) { - result = result && (getSint32() == other.getSint32()); + if (getSint32() != other.getSint32()) + return false; } - result = result && (hasSint64() == other.hasSint64()); + if (hasSint64() != other.hasSint64()) + return false; if (hasSint64()) { - result = result && (getSint64() == other.getSint64()); + if (getSint64() != other.getSint64()) + return false; } - result = result && (hasFixed32() == other.hasFixed32()); + if (hasFixed32() != other.hasFixed32()) + return false; if (hasFixed32()) { - result = result && (getFixed32() == other.getFixed32()); + if (getFixed32() != other.getFixed32()) + return false; } - result = result && (hasFixed64() == other.hasFixed64()); + if (hasFixed64() != other.hasFixed64()) + return false; if (hasFixed64()) { - result = result && (getFixed64() == other.getFixed64()); + if (getFixed64() != other.getFixed64()) + return false; } - result = result && (hasSfixed32() == other.hasSfixed32()); + if (hasSfixed32() != other.hasSfixed32()) + return false; if (hasSfixed32()) { - result = result && (getSfixed32() == other.getSfixed32()); + if (getSfixed32() != other.getSfixed32()) + return false; } - result = result && (hasSfixed64() == other.hasSfixed64()); + if (hasSfixed64() != other.hasSfixed64()) + return false; if (hasSfixed64()) { - result = result && (getSfixed64() == other.getSfixed64()); + if (getSfixed64() != other.getSfixed64()) + return false; } - result = result && (hasFloat() == other.hasFloat()); + if (hasFloat() != other.hasFloat()) + return false; if (hasFloat()) { - result = result - && (java.lang.Float.floatToIntBits(getFloat()) == java.lang.Float.floatToIntBits(other.getFloat())); + if (java.lang.Float.floatToIntBits(getFloat()) != java.lang.Float.floatToIntBits(other.getFloat())) + return false; } - result = result && (hasDouble() == other.hasDouble()); + if (hasDouble() != other.hasDouble()) + return false; if (hasDouble()) { - result = result - && (java.lang.Double.doubleToLongBits(getDouble()) == java.lang.Double.doubleToLongBits(other.getDouble())); + if (java.lang.Double.doubleToLongBits(getDouble()) != java.lang.Double.doubleToLongBits(other.getDouble())) + return false; } - result = result && (hasBool() == other.hasBool()); + if (hasBool() != other.hasBool()) + return false; if (hasBool()) { - result = result && (getBool() == other.getBool()); + if (getBool() != other.getBool()) + return false; } - result = result && (hasString() == other.hasString()); + if (hasString() != other.hasString()) + return false; if (hasString()) { - result = result && getString().equals(other.getString()); + if (!getString().equals(other.getString())) + return false; } - result = result && (hasBytes() == other.hasBytes()); + if (hasBytes() != other.hasBytes()) + return false; if (hasBytes()) { - result = result && getBytes().equals(other.getBytes()); + if (!getBytes().equals(other.getBytes())) + return false; } - result = result && (hasEnum() == other.hasEnum()); + if (hasEnum() != other.hasEnum()) + return false; if (hasEnum()) { - result = result && enum_ == other.enum_; + if (enum_ != other.enum_) + return false; } - result = result && getIntArrayList().equals(other.getIntArrayList()); - result = result && getFooArrayList().equals(other.getFooArrayList()); - result = result && syms_.equals(other.syms_); - result = result && (hasFoo() == other.hasFoo()); + if (!getIntArrayList().equals(other.getIntArrayList())) + return false; + if (!getFooArrayList().equals(other.getFooArrayList())) + return false; + if (!syms_.equals(other.syms_)) + return false; + if (hasFoo() != other.hasFoo()) + return false; if (hasFoo()) { - result = result && getFoo().equals(other.getFoo()); + if (!getFoo().equals(other.getFoo())) + return false; } - result = result && (hasTimestamp() == other.hasTimestamp()); + if (hasTimestamp() != other.hasTimestamp()) + return false; if (hasTimestamp()) { - result = result && getTimestamp().equals(other.getTimestamp()); + if (!getTimestamp().equals(other.getTimestamp())) + return false; } - result = result && unknownFields.equals(other.unknownFields); - return result; + if (!getUnknownFields().equals(other.getUnknownFields())) + return false; + return true; } @java.lang.Override @@ -1126,7 +1068,7 @@ public int hashCode() { hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; hash = (53 * hash) + getTimestamp().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1166,32 +1108,32 @@ public static org.apache.avro.protobuf.multiplefiles.Foo parseFrom(byte[] data, public static org.apache.avro.protobuf.multiplefiles.Foo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static org.apache.avro.protobuf.multiplefiles.Foo parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); } public static org.apache.avro.protobuf.multiplefiles.Foo parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static org.apache.avro.protobuf.multiplefiles.Foo parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static org.apache.avro.protobuf.multiplefiles.Foo parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static org.apache.avro.protobuf.multiplefiles.Foo parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override @@ -1213,7 +1155,7 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } @@ -1221,7 +1163,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build /** * Protobuf type {@code org.apache.avro.protobuf.multiplefiles.Foo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:org.apache.avro.protobuf.multiplefiles.Foo) org.apache.avro.protobuf.multiplefiles.FooOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -1229,7 +1171,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_Foo_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.multiplefiles.Foo.class, org.apache.avro.protobuf.multiplefiles.Foo.Builder.class); @@ -1240,13 +1182,13 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getFooArrayFieldBuilder(); getFooFieldBuilder(); getTimestampFieldBuilder(); @@ -1256,60 +1198,43 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; int32_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); int64_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); uint32_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); uint64_ = 0L; - bitField0_ = (bitField0_ & ~0x00000008); sint32_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); sint64_ = 0L; - bitField0_ = (bitField0_ & ~0x00000020); fixed32_ = 0; - bitField0_ = (bitField0_ & ~0x00000040); fixed64_ = 0L; - bitField0_ = (bitField0_ & ~0x00000080); sfixed32_ = 0; - bitField0_ = (bitField0_ & ~0x00000100); sfixed64_ = 0L; - bitField0_ = (bitField0_ & ~0x00000200); float_ = 0F; - bitField0_ = (bitField0_ & ~0x00000400); double_ = 0D; - bitField0_ = (bitField0_ & ~0x00000800); bool_ = false; - bitField0_ = (bitField0_ & ~0x00001000); string_ = ""; - bitField0_ = (bitField0_ & ~0x00002000); bytes_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00004000); enum_ = 3; - bitField0_ = (bitField0_ & ~0x00008000); - intArray_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00010000); + intArray_ = emptyIntList(); if (fooArrayBuilder_ == null) { fooArray_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00020000); } else { + fooArray_ = null; fooArrayBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00020000); syms_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00040000); - if (fooBuilder_ == null) { - foo_ = null; - } else { - fooBuilder_.clear(); + foo_ = null; + if (fooBuilder_ != null) { + fooBuilder_.dispose(); + fooBuilder_ = null; } - bitField0_ = (bitField0_ & ~0x00080000); - if (timestampBuilder_ == null) { - timestamp_ = null; - } else { - timestampBuilder_.clear(); + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; } - bitField0_ = (bitField0_ & ~0x00100000); return this; } @@ -1335,141 +1260,111 @@ public org.apache.avro.protobuf.multiplefiles.Foo build() { @java.lang.Override public org.apache.avro.protobuf.multiplefiles.Foo buildPartial() { org.apache.avro.protobuf.multiplefiles.Foo result = new org.apache.avro.protobuf.multiplefiles.Foo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.apache.avro.protobuf.multiplefiles.Foo result) { + if (fooArrayBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0)) { + fooArray_ = java.util.Collections.unmodifiableList(fooArray_); + bitField0_ = (bitField0_ & ~0x00020000); + } + result.fooArray_ = fooArray_; + } else { + result.fooArray_ = fooArrayBuilder_.build(); + } + if (((bitField0_ & 0x00040000) != 0)) { + syms_ = java.util.Collections.unmodifiableList(syms_); + bitField0_ = (bitField0_ & ~0x00040000); + } + result.syms_ = syms_; + } + + private void buildPartial0(org.apache.avro.protobuf.multiplefiles.Foo result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + if (((from_bitField0_ & 0x00000001) != 0)) { + result.int32_ = int32_; to_bitField0_ |= 0x00000001; } - result.int32_ = int32_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + if (((from_bitField0_ & 0x00000002) != 0)) { + result.int64_ = int64_; to_bitField0_ |= 0x00000002; } - result.int64_ = int64_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uint32_ = uint32_; to_bitField0_ |= 0x00000004; } - result.uint32_ = uint32_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + if (((from_bitField0_ & 0x00000008) != 0)) { + result.uint64_ = uint64_; to_bitField0_ |= 0x00000008; } - result.uint64_ = uint64_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + if (((from_bitField0_ & 0x00000010) != 0)) { + result.sint32_ = sint32_; to_bitField0_ |= 0x00000010; } - result.sint32_ = sint32_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + if (((from_bitField0_ & 0x00000020) != 0)) { + result.sint64_ = sint64_; to_bitField0_ |= 0x00000020; } - result.sint64_ = sint64_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + if (((from_bitField0_ & 0x00000040) != 0)) { + result.fixed32_ = fixed32_; to_bitField0_ |= 0x00000040; } - result.fixed32_ = fixed32_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + if (((from_bitField0_ & 0x00000080) != 0)) { + result.fixed64_ = fixed64_; to_bitField0_ |= 0x00000080; } - result.fixed64_ = fixed64_; - if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + if (((from_bitField0_ & 0x00000100) != 0)) { + result.sfixed32_ = sfixed32_; to_bitField0_ |= 0x00000100; } - result.sfixed32_ = sfixed32_; - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + if (((from_bitField0_ & 0x00000200) != 0)) { + result.sfixed64_ = sfixed64_; to_bitField0_ |= 0x00000200; } - result.sfixed64_ = sfixed64_; - if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + if (((from_bitField0_ & 0x00000400) != 0)) { + result.float_ = float_; to_bitField0_ |= 0x00000400; } - result.float_ = float_; - if (((from_bitField0_ & 0x00000800) == 0x00000800)) { + if (((from_bitField0_ & 0x00000800) != 0)) { + result.double_ = double_; to_bitField0_ |= 0x00000800; } - result.double_ = double_; - if (((from_bitField0_ & 0x00001000) == 0x00001000)) { + if (((from_bitField0_ & 0x00001000) != 0)) { + result.bool_ = bool_; to_bitField0_ |= 0x00001000; } - result.bool_ = bool_; - if (((from_bitField0_ & 0x00002000) == 0x00002000)) { + if (((from_bitField0_ & 0x00002000) != 0)) { + result.string_ = string_; to_bitField0_ |= 0x00002000; } - result.string_ = string_; - if (((from_bitField0_ & 0x00004000) == 0x00004000)) { + if (((from_bitField0_ & 0x00004000) != 0)) { + result.bytes_ = bytes_; to_bitField0_ |= 0x00004000; } - result.bytes_ = bytes_; - if (((from_bitField0_ & 0x00008000) == 0x00008000)) { + if (((from_bitField0_ & 0x00008000) != 0)) { + result.enum_ = enum_; to_bitField0_ |= 0x00008000; } - result.enum_ = enum_; - if (((bitField0_ & 0x00010000) == 0x00010000)) { - intArray_ = java.util.Collections.unmodifiableList(intArray_); - bitField0_ = (bitField0_ & ~0x00010000); - } - result.intArray_ = intArray_; - if (fooArrayBuilder_ == null) { - if (((bitField0_ & 0x00020000) == 0x00020000)) { - fooArray_ = java.util.Collections.unmodifiableList(fooArray_); - bitField0_ = (bitField0_ & ~0x00020000); - } - result.fooArray_ = fooArray_; - } else { - result.fooArray_ = fooArrayBuilder_.build(); - } - if (((bitField0_ & 0x00040000) == 0x00040000)) { - syms_ = java.util.Collections.unmodifiableList(syms_); - bitField0_ = (bitField0_ & ~0x00040000); + if (((from_bitField0_ & 0x00010000) != 0)) { + intArray_.makeImmutable(); + result.intArray_ = intArray_; } - result.syms_ = syms_; - if (((from_bitField0_ & 0x00080000) == 0x00080000)) { + if (((from_bitField0_ & 0x00080000) != 0)) { + result.foo_ = fooBuilder_ == null ? foo_ : fooBuilder_.build(); to_bitField0_ |= 0x00010000; } - if (fooBuilder_ == null) { - result.foo_ = foo_; - } else { - result.foo_ = fooBuilder_.build(); - } - if (((from_bitField0_ & 0x00100000) == 0x00100000)) { + if (((from_bitField0_ & 0x00100000) != 0)) { + result.timestamp_ = timestampBuilder_ == null ? timestamp_ : timestampBuilder_.build(); to_bitField0_ |= 0x00020000; } - if (timestampBuilder_ == null) { - result.timestamp_ = timestamp_; - } else { - result.timestamp_ = timestampBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - - @java.lang.Override - public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -1525,8 +1420,8 @@ public Builder mergeFrom(org.apache.avro.protobuf.multiplefiles.Foo other) { setBool(other.getBool()); } if (other.hasString()) { - bitField0_ |= 0x00002000; string_ = other.string_; + bitField0_ |= 0x00002000; onChanged(); } if (other.hasBytes()) { @@ -1538,7 +1433,8 @@ public Builder mergeFrom(org.apache.avro.protobuf.multiplefiles.Foo other) { if (!other.intArray_.isEmpty()) { if (intArray_.isEmpty()) { intArray_ = other.intArray_; - bitField0_ = (bitField0_ & ~0x00010000); + intArray_.makeImmutable(); + bitField0_ |= 0x00010000; } else { ensureIntArrayIsMutable(); intArray_.addAll(other.intArray_); @@ -1563,7 +1459,7 @@ public Builder mergeFrom(org.apache.avro.protobuf.multiplefiles.Foo other) { fooArrayBuilder_ = null; fooArray_ = other.fooArray_; bitField0_ = (bitField0_ & ~0x00020000); - fooArrayBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? getFooArrayFieldBuilder() + fooArrayBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getFooArrayFieldBuilder() : null; } else { fooArrayBuilder_.addAllMessages(other.fooArray_); @@ -1586,7 +1482,7 @@ public Builder mergeFrom(org.apache.avro.protobuf.multiplefiles.Foo other) { if (other.hasTimestamp()) { mergeTimestamp(other.getTimestamp()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -1612,17 +1508,183 @@ public final boolean isInitialized() { @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.apache.avro.protobuf.multiplefiles.Foo parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int32_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + int64_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + uint32_ = input.readUInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + uint64_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + sint32_ = input.readSInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + sint64_ = input.readSInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 61: { + fixed32_ = input.readFixed32(); + bitField0_ |= 0x00000040; + break; + } // case 61 + case 65: { + fixed64_ = input.readFixed64(); + bitField0_ |= 0x00000080; + break; + } // case 65 + case 77: { + sfixed32_ = input.readSFixed32(); + bitField0_ |= 0x00000100; + break; + } // case 77 + case 81: { + sfixed64_ = input.readSFixed64(); + bitField0_ |= 0x00000200; + break; + } // case 81 + case 93: { + float_ = input.readFloat(); + bitField0_ |= 0x00000400; + break; + } // case 93 + case 97: { + double_ = input.readDouble(); + bitField0_ |= 0x00000800; + break; + } // case 97 + case 104: { + bool_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 114: { + string_ = input.readBytes(); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 122: { + bytes_ = input.readBytes(); + bitField0_ |= 0x00004000; + break; + } // case 122 + case 128: { + int tmpRaw = input.readEnum(); + org.apache.avro.protobuf.multiplefiles.A tmpValue = org.apache.avro.protobuf.multiplefiles.A + .forNumber(tmpRaw); + if (tmpValue == null) { + mergeUnknownVarintField(16, tmpRaw); + } else { + enum_ = tmpRaw; + bitField0_ |= 0x00008000; + } + break; + } // case 128 + case 136: { + int v = input.readInt32(); + ensureIntArrayIsMutable(); + intArray_.addInt(v); + break; + } // case 136 + case 138: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureIntArrayIsMutable(); + while (input.getBytesUntilLimit() > 0) { + intArray_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 138 + case 146: { + input.readMessage(getFooFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 146 + case 152: { + int tmpRaw = input.readEnum(); + org.apache.avro.protobuf.multiplefiles.A tmpValue = org.apache.avro.protobuf.multiplefiles.A + .forNumber(tmpRaw); + if (tmpValue == null) { + mergeUnknownVarintField(19, tmpRaw); + } else { + ensureSymsIsMutable(); + syms_.add(tmpRaw); + } + break; + } // case 152 + case 154: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + org.apache.avro.protobuf.multiplefiles.A tmpValue = org.apache.avro.protobuf.multiplefiles.A + .forNumber(tmpRaw); + if (tmpValue == null) { + mergeUnknownVarintField(19, tmpRaw); + } else { + ensureSymsIsMutable(); + syms_.add(tmpRaw); + } + } + input.popLimit(oldLimit); + break; + } // case 154 + case 162: { + org.apache.avro.protobuf.multiplefiles.Foo m = input + .readMessage(org.apache.avro.protobuf.multiplefiles.Foo.parser(), extensionRegistry); + if (fooArrayBuilder_ == null) { + ensureFooArrayIsMutable(); + fooArray_.add(m); + } else { + fooArrayBuilder_.addMessage(m); + } + break; + } // case 162 + case 170: { + input.readMessage(getTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00100000; + break; + } // case 170 + 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) { - parsedMessage = (org.apache.avro.protobuf.multiplefiles.Foo) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -1636,9 +1698,12 @@ public Builder mergeFrom(com.google.protobuf.CodedInputStream input, * * * required int32 int32 = 1; + * + * @return Whether the int32 field is set. */ + @java.lang.Override public boolean hasInt32() { - return ((bitField0_ & 0x00000001) == 0x00000001); + return ((bitField0_ & 0x00000001) != 0); } /** @@ -1647,7 +1712,10 @@ public boolean hasInt32() { * * * required int32 int32 = 1; + * + * @return The int32. */ + @java.lang.Override public int getInt32() { return int32_; } @@ -1658,10 +1726,14 @@ public int getInt32() { * * * required int32 int32 = 1; + * + * @param value The int32 to set. + * @return This builder for chaining. */ public Builder setInt32(int value) { - bitField0_ |= 0x00000001; + int32_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -1672,6 +1744,8 @@ public Builder setInt32(int value) { * * * required int32 int32 = 1; + * + * @return This builder for chaining. */ public Builder clearInt32() { bitField0_ = (bitField0_ & ~0x00000001); @@ -1684,30 +1758,42 @@ public Builder clearInt32() { /** * optional int64 int64 = 2; + * + * @return Whether the int64 field is set. */ + @java.lang.Override public boolean hasInt64() { - return ((bitField0_ & 0x00000002) == 0x00000002); + return ((bitField0_ & 0x00000002) != 0); } /** * optional int64 int64 = 2; + * + * @return The int64. */ + @java.lang.Override public long getInt64() { return int64_; } /** * optional int64 int64 = 2; + * + * @param value The int64 to set. + * @return This builder for chaining. */ public Builder setInt64(long value) { - bitField0_ |= 0x00000002; + int64_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } /** * optional int64 int64 = 2; + * + * @return This builder for chaining. */ public Builder clearInt64() { bitField0_ = (bitField0_ & ~0x00000002); @@ -1720,30 +1806,42 @@ public Builder clearInt64() { /** * optional uint32 uint32 = 3; + * + * @return Whether the uint32 field is set. */ + @java.lang.Override public boolean hasUint32() { - return ((bitField0_ & 0x00000004) == 0x00000004); + return ((bitField0_ & 0x00000004) != 0); } /** * optional uint32 uint32 = 3; + * + * @return The uint32. */ + @java.lang.Override public int getUint32() { return uint32_; } /** * optional uint32 uint32 = 3; + * + * @param value The uint32 to set. + * @return This builder for chaining. */ public Builder setUint32(int value) { - bitField0_ |= 0x00000004; + uint32_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } /** * optional uint32 uint32 = 3; + * + * @return This builder for chaining. */ public Builder clearUint32() { bitField0_ = (bitField0_ & ~0x00000004); @@ -1756,30 +1854,42 @@ public Builder clearUint32() { /** * optional uint64 uint64 = 4; + * + * @return Whether the uint64 field is set. */ + @java.lang.Override public boolean hasUint64() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000008) != 0); } /** * optional uint64 uint64 = 4; + * + * @return The uint64. */ + @java.lang.Override public long getUint64() { return uint64_; } /** * optional uint64 uint64 = 4; + * + * @param value The uint64 to set. + * @return This builder for chaining. */ public Builder setUint64(long value) { - bitField0_ |= 0x00000008; + uint64_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } /** * optional uint64 uint64 = 4; + * + * @return This builder for chaining. */ public Builder clearUint64() { bitField0_ = (bitField0_ & ~0x00000008); @@ -1792,30 +1902,42 @@ public Builder clearUint64() { /** * optional sint32 sint32 = 5; + * + * @return Whether the sint32 field is set. */ + @java.lang.Override public boolean hasSint32() { - return ((bitField0_ & 0x00000010) == 0x00000010); + return ((bitField0_ & 0x00000010) != 0); } /** * optional sint32 sint32 = 5; + * + * @return The sint32. */ + @java.lang.Override public int getSint32() { return sint32_; } /** * optional sint32 sint32 = 5; + * + * @param value The sint32 to set. + * @return This builder for chaining. */ public Builder setSint32(int value) { - bitField0_ |= 0x00000010; + sint32_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } /** * optional sint32 sint32 = 5; + * + * @return This builder for chaining. */ public Builder clearSint32() { bitField0_ = (bitField0_ & ~0x00000010); @@ -1828,30 +1950,42 @@ public Builder clearSint32() { /** * optional sint64 sint64 = 6; + * + * @return Whether the sint64 field is set. */ + @java.lang.Override public boolean hasSint64() { - return ((bitField0_ & 0x00000020) == 0x00000020); + return ((bitField0_ & 0x00000020) != 0); } /** * optional sint64 sint64 = 6; + * + * @return The sint64. */ + @java.lang.Override public long getSint64() { return sint64_; } /** * optional sint64 sint64 = 6; + * + * @param value The sint64 to set. + * @return This builder for chaining. */ public Builder setSint64(long value) { - bitField0_ |= 0x00000020; + sint64_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } /** * optional sint64 sint64 = 6; + * + * @return This builder for chaining. */ public Builder clearSint64() { bitField0_ = (bitField0_ & ~0x00000020); @@ -1864,30 +1998,42 @@ public Builder clearSint64() { /** * optional fixed32 fixed32 = 7; + * + * @return Whether the fixed32 field is set. */ + @java.lang.Override public boolean hasFixed32() { - return ((bitField0_ & 0x00000040) == 0x00000040); + return ((bitField0_ & 0x00000040) != 0); } /** * optional fixed32 fixed32 = 7; + * + * @return The fixed32. */ + @java.lang.Override public int getFixed32() { return fixed32_; } /** * optional fixed32 fixed32 = 7; + * + * @param value The fixed32 to set. + * @return This builder for chaining. */ public Builder setFixed32(int value) { - bitField0_ |= 0x00000040; + fixed32_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } /** * optional fixed32 fixed32 = 7; + * + * @return This builder for chaining. */ public Builder clearFixed32() { bitField0_ = (bitField0_ & ~0x00000040); @@ -1900,30 +2046,42 @@ public Builder clearFixed32() { /** * optional fixed64 fixed64 = 8; + * + * @return Whether the fixed64 field is set. */ + @java.lang.Override public boolean hasFixed64() { - return ((bitField0_ & 0x00000080) == 0x00000080); + return ((bitField0_ & 0x00000080) != 0); } /** * optional fixed64 fixed64 = 8; + * + * @return The fixed64. */ + @java.lang.Override public long getFixed64() { return fixed64_; } /** * optional fixed64 fixed64 = 8; + * + * @param value The fixed64 to set. + * @return This builder for chaining. */ public Builder setFixed64(long value) { - bitField0_ |= 0x00000080; + fixed64_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } /** * optional fixed64 fixed64 = 8; + * + * @return This builder for chaining. */ public Builder clearFixed64() { bitField0_ = (bitField0_ & ~0x00000080); @@ -1936,30 +2094,42 @@ public Builder clearFixed64() { /** * optional sfixed32 sfixed32 = 9; + * + * @return Whether the sfixed32 field is set. */ + @java.lang.Override public boolean hasSfixed32() { - return ((bitField0_ & 0x00000100) == 0x00000100); + return ((bitField0_ & 0x00000100) != 0); } /** * optional sfixed32 sfixed32 = 9; + * + * @return The sfixed32. */ + @java.lang.Override public int getSfixed32() { return sfixed32_; } /** * optional sfixed32 sfixed32 = 9; + * + * @param value The sfixed32 to set. + * @return This builder for chaining. */ public Builder setSfixed32(int value) { - bitField0_ |= 0x00000100; + sfixed32_ = value; + bitField0_ |= 0x00000100; onChanged(); return this; } /** * optional sfixed32 sfixed32 = 9; + * + * @return This builder for chaining. */ public Builder clearSfixed32() { bitField0_ = (bitField0_ & ~0x00000100); @@ -1972,30 +2142,42 @@ public Builder clearSfixed32() { /** * optional sfixed64 sfixed64 = 10; + * + * @return Whether the sfixed64 field is set. */ + @java.lang.Override public boolean hasSfixed64() { - return ((bitField0_ & 0x00000200) == 0x00000200); + return ((bitField0_ & 0x00000200) != 0); } /** * optional sfixed64 sfixed64 = 10; + * + * @return The sfixed64. */ + @java.lang.Override public long getSfixed64() { return sfixed64_; } /** * optional sfixed64 sfixed64 = 10; + * + * @param value The sfixed64 to set. + * @return This builder for chaining. */ public Builder setSfixed64(long value) { - bitField0_ |= 0x00000200; + sfixed64_ = value; + bitField0_ |= 0x00000200; onChanged(); return this; } /** * optional sfixed64 sfixed64 = 10; + * + * @return This builder for chaining. */ public Builder clearSfixed64() { bitField0_ = (bitField0_ & ~0x00000200); @@ -2008,30 +2190,42 @@ public Builder clearSfixed64() { /** * optional float float = 11; + * + * @return Whether the float field is set. */ + @java.lang.Override public boolean hasFloat() { - return ((bitField0_ & 0x00000400) == 0x00000400); + return ((bitField0_ & 0x00000400) != 0); } /** * optional float float = 11; + * + * @return The float. */ + @java.lang.Override public float getFloat() { return float_; } /** * optional float float = 11; + * + * @param value The float to set. + * @return This builder for chaining. */ public Builder setFloat(float value) { - bitField0_ |= 0x00000400; + float_ = value; + bitField0_ |= 0x00000400; onChanged(); return this; } /** * optional float float = 11; + * + * @return This builder for chaining. */ public Builder clearFloat() { bitField0_ = (bitField0_ & ~0x00000400); @@ -2044,30 +2238,42 @@ public Builder clearFloat() { /** * optional double double = 12; + * + * @return Whether the double field is set. */ + @java.lang.Override public boolean hasDouble() { - return ((bitField0_ & 0x00000800) == 0x00000800); + return ((bitField0_ & 0x00000800) != 0); } /** * optional double double = 12; + * + * @return The double. */ + @java.lang.Override public double getDouble() { return double_; } /** * optional double double = 12; + * + * @param value The double to set. + * @return This builder for chaining. */ public Builder setDouble(double value) { - bitField0_ |= 0x00000800; + double_ = value; + bitField0_ |= 0x00000800; onChanged(); return this; } /** * optional double double = 12; + * + * @return This builder for chaining. */ public Builder clearDouble() { bitField0_ = (bitField0_ & ~0x00000800); @@ -2080,30 +2286,42 @@ public Builder clearDouble() { /** * optional bool bool = 13; + * + * @return Whether the bool field is set. */ + @java.lang.Override public boolean hasBool() { - return ((bitField0_ & 0x00001000) == 0x00001000); + return ((bitField0_ & 0x00001000) != 0); } /** * optional bool bool = 13; + * + * @return The bool. */ + @java.lang.Override public boolean getBool() { return bool_; } /** * optional bool bool = 13; + * + * @param value The bool to set. + * @return This builder for chaining. */ public Builder setBool(boolean value) { - bitField0_ |= 0x00001000; + bool_ = value; + bitField0_ |= 0x00001000; onChanged(); return this; } /** * optional bool bool = 13; + * + * @return This builder for chaining. */ public Builder clearBool() { bitField0_ = (bitField0_ & ~0x00001000); @@ -2116,13 +2334,17 @@ public Builder clearBool() { /** * optional string string = 14; + * + * @return Whether the string field is set. */ public boolean hasString() { - return ((bitField0_ & 0x00002000) == 0x00002000); + return ((bitField0_ & 0x00002000) != 0); } /** * optional string string = 14; + * + * @return The string. */ public java.lang.String getString() { java.lang.Object ref = string_; @@ -2140,6 +2362,8 @@ public java.lang.String getString() { /** * optional string string = 14; + * + * @return The bytes for string. */ public com.google.protobuf.ByteString getStringBytes() { java.lang.Object ref = string_; @@ -2154,36 +2378,44 @@ public com.google.protobuf.ByteString getStringBytes() { /** * optional string string = 14; + * + * @param value The string to set. + * @return This builder for chaining. */ public Builder setString(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00002000; string_ = value; + bitField0_ |= 0x00002000; onChanged(); return this; } /** * optional string string = 14; + * + * @return This builder for chaining. */ public Builder clearString() { - bitField0_ = (bitField0_ & ~0x00002000); string_ = getDefaultInstance().getString(); + bitField0_ = (bitField0_ & ~0x00002000); onChanged(); return this; } /** * optional string string = 14; + * + * @param value The bytes for string to set. + * @return This builder for chaining. */ public Builder setStringBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00002000; string_ = value; + bitField0_ |= 0x00002000; onChanged(); return this; } @@ -2192,33 +2424,44 @@ public Builder setStringBytes(com.google.protobuf.ByteString value) { /** * optional bytes bytes = 15; + * + * @return Whether the bytes field is set. */ + @java.lang.Override public boolean hasBytes() { - return ((bitField0_ & 0x00004000) == 0x00004000); + return ((bitField0_ & 0x00004000) != 0); } /** * optional bytes bytes = 15; + * + * @return The bytes. */ + @java.lang.Override public com.google.protobuf.ByteString getBytes() { return bytes_; } /** * optional bytes bytes = 15; + * + * @param value The bytes to set. + * @return This builder for chaining. */ public Builder setBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00004000; bytes_ = value; + bitField0_ |= 0x00004000; onChanged(); return this; } /** * optional bytes bytes = 15; + * + * @return This builder for chaining. */ public Builder clearBytes() { bitField0_ = (bitField0_ & ~0x00004000); @@ -2231,22 +2474,30 @@ public Builder clearBytes() { /** * optional .org.apache.avro.protobuf.multiplefiles.A enum = 16 [default = Z]; + * + * @return Whether the enum field is set. */ + @java.lang.Override public boolean hasEnum() { - return ((bitField0_ & 0x00008000) == 0x00008000); + return ((bitField0_ & 0x00008000) != 0); } /** * optional .org.apache.avro.protobuf.multiplefiles.A enum = 16 [default = Z]; + * + * @return The enum. */ + @java.lang.Override public org.apache.avro.protobuf.multiplefiles.A getEnum() { - @SuppressWarnings("deprecation") - org.apache.avro.protobuf.multiplefiles.A result = org.apache.avro.protobuf.multiplefiles.A.valueOf(enum_); + org.apache.avro.protobuf.multiplefiles.A result = org.apache.avro.protobuf.multiplefiles.A.forNumber(enum_); return result == null ? org.apache.avro.protobuf.multiplefiles.A.Z : result; } /** * optional .org.apache.avro.protobuf.multiplefiles.A enum = 16 [default = Z]; + * + * @param value The enum to set. + * @return This builder for chaining. */ public Builder setEnum(org.apache.avro.protobuf.multiplefiles.A value) { if (value == null) { @@ -2260,6 +2511,8 @@ public Builder setEnum(org.apache.avro.protobuf.multiplefiles.A value) { /** * optional .org.apache.avro.protobuf.multiplefiles.A enum = 16 [default = Z]; + * + * @return This builder for chaining. */ public Builder clearEnum() { bitField0_ = (bitField0_ & ~0x00008000); @@ -2268,13 +2521,13 @@ public Builder clearEnum() { return this; } - private java.util.List intArray_ = java.util.Collections.emptyList(); + private com.google.protobuf.Internal.IntList intArray_ = emptyIntList(); private void ensureIntArrayIsMutable() { - if (!((bitField0_ & 0x00010000) == 0x00010000)) { - intArray_ = new java.util.ArrayList(intArray_); - bitField0_ |= 0x00010000; + if (!intArray_.isModifiable()) { + intArray_ = makeMutableCopy(intArray_); } + bitField0_ |= 0x00010000; } /** @@ -2283,9 +2536,12 @@ private void ensureIntArrayIsMutable() { * * * repeated int32 intArray = 17; + * + * @return A list containing the intArray. */ public java.util.List getIntArrayList() { - return java.util.Collections.unmodifiableList(intArray_); + intArray_.makeImmutable(); + return intArray_; } /** @@ -2294,6 +2550,8 @@ public java.util.List getIntArrayList() { * * * repeated int32 intArray = 17; + * + * @return The count of intArray. */ public int getIntArrayCount() { return intArray_.size(); @@ -2305,9 +2563,12 @@ public int getIntArrayCount() { * * * repeated int32 intArray = 17; + * + * @param index The index of the element to return. + * @return The intArray at the given index. */ public int getIntArray(int index) { - return intArray_.get(index); + return intArray_.getInt(index); } /** @@ -2316,10 +2577,16 @@ public int getIntArray(int index) { * * * repeated int32 intArray = 17; + * + * @param index The index to set the value at. + * @param value The intArray to set. + * @return This builder for chaining. */ public Builder setIntArray(int index, int value) { + ensureIntArrayIsMutable(); - intArray_.set(index, value); + intArray_.setInt(index, value); + bitField0_ |= 0x00010000; onChanged(); return this; } @@ -2330,10 +2597,15 @@ public Builder setIntArray(int index, int value) { * * * repeated int32 intArray = 17; + * + * @param value The intArray to add. + * @return This builder for chaining. */ public Builder addIntArray(int value) { + ensureIntArrayIsMutable(); - intArray_.add(value); + intArray_.addInt(value); + bitField0_ |= 0x00010000; onChanged(); return this; } @@ -2344,10 +2616,14 @@ public Builder addIntArray(int value) { * * * repeated int32 intArray = 17; + * + * @param values The intArray to add. + * @return This builder for chaining. */ public Builder addAllIntArray(java.lang.Iterable values) { ensureIntArrayIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, intArray_); + bitField0_ |= 0x00010000; onChanged(); return this; } @@ -2358,9 +2634,11 @@ public Builder addAllIntArray(java.lang.Iterable va * * * repeated int32 intArray = 17; + * + * @return This builder for chaining. */ public Builder clearIntArray() { - intArray_ = java.util.Collections.emptyList(); + intArray_ = emptyIntList(); bitField0_ = (bitField0_ & ~0x00010000); onChanged(); return this; @@ -2369,13 +2647,13 @@ public Builder clearIntArray() { private java.util.List fooArray_ = java.util.Collections.emptyList(); private void ensureFooArrayIsMutable() { - if (!((bitField0_ & 0x00020000) == 0x00020000)) { + if (!((bitField0_ & 0x00020000) != 0)) { fooArray_ = new java.util.ArrayList(fooArray_); bitField0_ |= 0x00020000; } } - private com.google.protobuf.RepeatedFieldBuilderV3 fooArrayBuilder_; + private com.google.protobuf.RepeatedFieldBuilder fooArrayBuilder_; /** * repeated .org.apache.avro.protobuf.multiplefiles.Foo fooArray = 20; @@ -2596,10 +2874,10 @@ public java.util.List getFoo return getFooArrayFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3 getFooArrayFieldBuilder() { + private com.google.protobuf.RepeatedFieldBuilder getFooArrayFieldBuilder() { if (fooArrayBuilder_ == null) { - fooArrayBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3( - fooArray_, ((bitField0_ & 0x00020000) == 0x00020000), getParentForChildren(), isClean()); + fooArrayBuilder_ = new com.google.protobuf.RepeatedFieldBuilder( + fooArray_, ((bitField0_ & 0x00020000) != 0), getParentForChildren(), isClean()); fooArray_ = null; } return fooArrayBuilder_; @@ -2608,7 +2886,7 @@ private com.google.protobuf.RepeatedFieldBuilderV3 syms_ = java.util.Collections.emptyList(); private void ensureSymsIsMutable() { - if (!((bitField0_ & 0x00040000) == 0x00040000)) { + if (!((bitField0_ & 0x00040000) != 0)) { syms_ = new java.util.ArrayList(syms_); bitField0_ |= 0x00040000; } @@ -2616,6 +2894,8 @@ private void ensureSymsIsMutable() { /** * repeated .org.apache.avro.protobuf.multiplefiles.A syms = 19; + * + * @return A list containing the syms. */ public java.util.List getSymsList() { return new com.google.protobuf.Internal.ListAdapter( @@ -2624,6 +2904,8 @@ public java.util.List getSymsList() { /** * repeated .org.apache.avro.protobuf.multiplefiles.A syms = 19; + * + * @return The count of syms. */ public int getSymsCount() { return syms_.size(); @@ -2631,6 +2913,9 @@ public int getSymsCount() { /** * repeated .org.apache.avro.protobuf.multiplefiles.A syms = 19; + * + * @param index The index of the element to return. + * @return The syms at the given index. */ public org.apache.avro.protobuf.multiplefiles.A getSyms(int index) { return syms_converter_.convert(syms_.get(index)); @@ -2638,6 +2923,10 @@ public org.apache.avro.protobuf.multiplefiles.A getSyms(int index) { /** * repeated .org.apache.avro.protobuf.multiplefiles.A syms = 19; + * + * @param index The index to set the value at. + * @param value The syms to set. + * @return This builder for chaining. */ public Builder setSyms(int index, org.apache.avro.protobuf.multiplefiles.A value) { if (value == null) { @@ -2651,6 +2940,9 @@ public Builder setSyms(int index, org.apache.avro.protobuf.multiplefiles.A value /** * repeated .org.apache.avro.protobuf.multiplefiles.A syms = 19; + * + * @param value The syms to add. + * @return This builder for chaining. */ public Builder addSyms(org.apache.avro.protobuf.multiplefiles.A value) { if (value == null) { @@ -2664,6 +2956,9 @@ public Builder addSyms(org.apache.avro.protobuf.multiplefiles.A value) { /** * repeated .org.apache.avro.protobuf.multiplefiles.A syms = 19; + * + * @param values The syms to add. + * @return This builder for chaining. */ public Builder addAllSyms(java.lang.Iterable values) { ensureSymsIsMutable(); @@ -2676,6 +2971,8 @@ public Builder addAllSyms(java.lang.Iterablerepeated .org.apache.avro.protobuf.multiplefiles.A syms = 19; + * + * @return This builder for chaining. */ public Builder clearSyms() { syms_ = java.util.Collections.emptyList(); @@ -2684,8 +2981,8 @@ public Builder clearSyms() { return this; } - private org.apache.avro.protobuf.multiplefiles.Foo foo_ = null; - private com.google.protobuf.SingleFieldBuilderV3 fooBuilder_; + private org.apache.avro.protobuf.multiplefiles.Foo foo_; + private com.google.protobuf.SingleFieldBuilder fooBuilder_; /** *
@@ -2693,9 +2990,11 @@ public Builder clearSyms() {
      * 
* * optional .org.apache.avro.protobuf.multiplefiles.Foo foo = 18; + * + * @return Whether the foo field is set. */ public boolean hasFoo() { - return ((bitField0_ & 0x00080000) == 0x00080000); + return ((bitField0_ & 0x00080000) != 0); } /** @@ -2704,6 +3003,8 @@ public boolean hasFoo() { * * * optional .org.apache.avro.protobuf.multiplefiles.Foo foo = 18; + * + * @return The foo. */ public org.apache.avro.protobuf.multiplefiles.Foo getFoo() { if (fooBuilder_ == null) { @@ -2726,11 +3027,11 @@ public Builder setFoo(org.apache.avro.protobuf.multiplefiles.Foo value) { throw new NullPointerException(); } foo_ = value; - onChanged(); } else { fooBuilder_.setMessage(value); } bitField0_ |= 0x00080000; + onChanged(); return this; } @@ -2744,11 +3045,11 @@ public Builder setFoo(org.apache.avro.protobuf.multiplefiles.Foo value) { public Builder setFoo(org.apache.avro.protobuf.multiplefiles.Foo.Builder builderForValue) { if (fooBuilder_ == null) { foo_ = builderForValue.build(); - onChanged(); } else { fooBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00080000; + onChanged(); return this; } @@ -2761,17 +3062,19 @@ public Builder setFoo(org.apache.avro.protobuf.multiplefiles.Foo.Builder builder */ public Builder mergeFoo(org.apache.avro.protobuf.multiplefiles.Foo value) { if (fooBuilder_ == null) { - if (((bitField0_ & 0x00080000) == 0x00080000) && foo_ != null + if (((bitField0_ & 0x00080000) != 0) && foo_ != null && foo_ != org.apache.avro.protobuf.multiplefiles.Foo.getDefaultInstance()) { - foo_ = org.apache.avro.protobuf.multiplefiles.Foo.newBuilder(foo_).mergeFrom(value).buildPartial(); + getFooBuilder().mergeFrom(value); } else { foo_ = value; } - onChanged(); } else { fooBuilder_.mergeFrom(value); } - bitField0_ |= 0x00080000; + if (foo_ != null) { + bitField0_ |= 0x00080000; + onChanged(); + } return this; } @@ -2783,13 +3086,13 @@ public Builder mergeFoo(org.apache.avro.protobuf.multiplefiles.Foo value) { * optional .org.apache.avro.protobuf.multiplefiles.Foo foo = 18; */ public Builder clearFoo() { - if (fooBuilder_ == null) { - foo_ = null; - onChanged(); - } else { - fooBuilder_.clear(); - } bitField0_ = (bitField0_ & ~0x00080000); + foo_ = null; + if (fooBuilder_ != null) { + fooBuilder_.dispose(); + fooBuilder_ = null; + } + onChanged(); return this; } @@ -2828,17 +3131,17 @@ public org.apache.avro.protobuf.multiplefiles.FooOrBuilder getFooOrBuilder() { * * optional .org.apache.avro.protobuf.multiplefiles.Foo foo = 18; */ - private com.google.protobuf.SingleFieldBuilderV3 getFooFieldBuilder() { + private com.google.protobuf.SingleFieldBuilder getFooFieldBuilder() { if (fooBuilder_ == null) { - fooBuilder_ = new com.google.protobuf.SingleFieldBuilderV3( + fooBuilder_ = new com.google.protobuf.SingleFieldBuilder( getFoo(), getParentForChildren(), isClean()); foo_ = null; } return fooBuilder_; } - private com.google.protobuf.Timestamp timestamp_ = null; - private com.google.protobuf.SingleFieldBuilderV3 timestampBuilder_; + private com.google.protobuf.Timestamp timestamp_; + private com.google.protobuf.SingleFieldBuilder timestampBuilder_; /** *
@@ -2846,9 +3149,11 @@ private com.google.protobuf.SingleFieldBuilderV3
      *
      * optional .google.protobuf.Timestamp timestamp = 21;
+     * 
+     * @return Whether the timestamp field is set.
      */
     public boolean hasTimestamp() {
-      return ((bitField0_ & 0x00100000) == 0x00100000);
+      return ((bitField0_ & 0x00100000) != 0);
     }
 
     /**
@@ -2857,6 +3162,8 @@ public boolean hasTimestamp() {
      * 
* * optional .google.protobuf.Timestamp timestamp = 21; + * + * @return The timestamp. */ public com.google.protobuf.Timestamp getTimestamp() { if (timestampBuilder_ == null) { @@ -2879,11 +3186,11 @@ public Builder setTimestamp(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } timestamp_ = value; - onChanged(); } else { timestampBuilder_.setMessage(value); } bitField0_ |= 0x00100000; + onChanged(); return this; } @@ -2897,11 +3204,11 @@ public Builder setTimestamp(com.google.protobuf.Timestamp value) { public Builder setTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { if (timestampBuilder_ == null) { timestamp_ = builderForValue.build(); - onChanged(); } else { timestampBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00100000; + onChanged(); return this; } @@ -2914,17 +3221,19 @@ public Builder setTimestamp(com.google.protobuf.Timestamp.Builder builderForValu */ public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { if (timestampBuilder_ == null) { - if (((bitField0_ & 0x00100000) == 0x00100000) && timestamp_ != null + if (((bitField0_ & 0x00100000) != 0) && timestamp_ != null && timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { - timestamp_ = com.google.protobuf.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + getTimestampBuilder().mergeFrom(value); } else { timestamp_ = value; } - onChanged(); } else { timestampBuilder_.mergeFrom(value); } - bitField0_ |= 0x00100000; + if (timestamp_ != null) { + bitField0_ |= 0x00100000; + onChanged(); + } return this; } @@ -2936,13 +3245,13 @@ public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { * optional .google.protobuf.Timestamp timestamp = 21; */ public Builder clearTimestamp() { - if (timestampBuilder_ == null) { - timestamp_ = null; - onChanged(); - } else { - timestampBuilder_.clear(); - } bitField0_ = (bitField0_ & ~0x00100000); + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + onChanged(); return this; } @@ -2981,25 +3290,15 @@ public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { * * optional .google.protobuf.Timestamp timestamp = 21; */ - private com.google.protobuf.SingleFieldBuilderV3 getTimestampFieldBuilder() { + private com.google.protobuf.SingleFieldBuilder getTimestampFieldBuilder() { if (timestampBuilder_ == null) { - timestampBuilder_ = new com.google.protobuf.SingleFieldBuilderV3( + timestampBuilder_ = new com.google.protobuf.SingleFieldBuilder( getTimestamp(), getParentForChildren(), isClean()); timestamp_ = null; } return timestampBuilder_; } - @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.avro.protobuf.multiplefiles.Foo) } @@ -3013,13 +3312,22 @@ public static org.apache.avro.protobuf.multiplefiles.Foo getDefaultInstance() { return DEFAULT_INSTANCE; } - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Foo parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Foo(input, extensionRegistry); + 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(); } }; diff --git a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/FooOrBuilder.java b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/FooOrBuilder.java index 66c86920371..a3858d1a388 100644 --- a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/FooOrBuilder.java +++ b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/FooOrBuilder.java @@ -1,6 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: src/test/protobuf/test_multiple_files.proto +// Protobuf Java Version: 4.26.1 package org.apache.avro.protobuf.multiplefiles; public interface FooOrBuilder extends @@ -13,6 +14,8 @@ public interface FooOrBuilder extends * * * required int32 int32 = 1; + * + * @return Whether the int32 field is set. */ boolean hasInt32(); @@ -22,161 +25,225 @@ public interface FooOrBuilder extends * * * required int32 int32 = 1; + * + * @return The int32. */ int getInt32(); /** * optional int64 int64 = 2; + * + * @return Whether the int64 field is set. */ boolean hasInt64(); /** * optional int64 int64 = 2; + * + * @return The int64. */ long getInt64(); /** * optional uint32 uint32 = 3; + * + * @return Whether the uint32 field is set. */ boolean hasUint32(); /** * optional uint32 uint32 = 3; + * + * @return The uint32. */ int getUint32(); /** * optional uint64 uint64 = 4; + * + * @return Whether the uint64 field is set. */ boolean hasUint64(); /** * optional uint64 uint64 = 4; + * + * @return The uint64. */ long getUint64(); /** * optional sint32 sint32 = 5; + * + * @return Whether the sint32 field is set. */ boolean hasSint32(); /** * optional sint32 sint32 = 5; + * + * @return The sint32. */ int getSint32(); /** * optional sint64 sint64 = 6; + * + * @return Whether the sint64 field is set. */ boolean hasSint64(); /** * optional sint64 sint64 = 6; + * + * @return The sint64. */ long getSint64(); /** * optional fixed32 fixed32 = 7; + * + * @return Whether the fixed32 field is set. */ boolean hasFixed32(); /** * optional fixed32 fixed32 = 7; + * + * @return The fixed32. */ int getFixed32(); /** * optional fixed64 fixed64 = 8; + * + * @return Whether the fixed64 field is set. */ boolean hasFixed64(); /** * optional fixed64 fixed64 = 8; + * + * @return The fixed64. */ long getFixed64(); /** * optional sfixed32 sfixed32 = 9; + * + * @return Whether the sfixed32 field is set. */ boolean hasSfixed32(); /** * optional sfixed32 sfixed32 = 9; + * + * @return The sfixed32. */ int getSfixed32(); /** * optional sfixed64 sfixed64 = 10; + * + * @return Whether the sfixed64 field is set. */ boolean hasSfixed64(); /** * optional sfixed64 sfixed64 = 10; + * + * @return The sfixed64. */ long getSfixed64(); /** * optional float float = 11; + * + * @return Whether the float field is set. */ boolean hasFloat(); /** * optional float float = 11; + * + * @return The float. */ float getFloat(); /** * optional double double = 12; + * + * @return Whether the double field is set. */ boolean hasDouble(); /** * optional double double = 12; + * + * @return The double. */ double getDouble(); /** * optional bool bool = 13; + * + * @return Whether the bool field is set. */ boolean hasBool(); /** * optional bool bool = 13; + * + * @return The bool. */ boolean getBool(); /** * optional string string = 14; + * + * @return Whether the string field is set. */ boolean hasString(); /** * optional string string = 14; + * + * @return The string. */ java.lang.String getString(); /** * optional string string = 14; + * + * @return The bytes for string. */ com.google.protobuf.ByteString getStringBytes(); /** * optional bytes bytes = 15; + * + * @return Whether the bytes field is set. */ boolean hasBytes(); /** * optional bytes bytes = 15; + * + * @return The bytes. */ com.google.protobuf.ByteString getBytes(); /** * optional .org.apache.avro.protobuf.multiplefiles.A enum = 16 [default = Z]; + * + * @return Whether the enum field is set. */ boolean hasEnum(); /** * optional .org.apache.avro.protobuf.multiplefiles.A enum = 16 [default = Z]; + * + * @return The enum. */ org.apache.avro.protobuf.multiplefiles.A getEnum(); @@ -186,6 +253,8 @@ public interface FooOrBuilder extends * * * repeated int32 intArray = 17; + * + * @return A list containing the intArray. */ java.util.List getIntArrayList(); @@ -195,6 +264,8 @@ public interface FooOrBuilder extends * * * repeated int32 intArray = 17; + * + * @return The count of intArray. */ int getIntArrayCount(); @@ -204,6 +275,9 @@ public interface FooOrBuilder extends * * * repeated int32 intArray = 17; + * + * @param index The index of the element to return. + * @return The intArray at the given index. */ int getIntArray(int index); @@ -234,16 +308,23 @@ public interface FooOrBuilder extends /** * repeated .org.apache.avro.protobuf.multiplefiles.A syms = 19; + * + * @return A list containing the syms. */ java.util.List getSymsList(); /** * repeated .org.apache.avro.protobuf.multiplefiles.A syms = 19; + * + * @return The count of syms. */ int getSymsCount(); /** * repeated .org.apache.avro.protobuf.multiplefiles.A syms = 19; + * + * @param index The index of the element to return. + * @return The syms at the given index. */ org.apache.avro.protobuf.multiplefiles.A getSyms(int index); @@ -253,6 +334,8 @@ public interface FooOrBuilder extends * * * optional .org.apache.avro.protobuf.multiplefiles.Foo foo = 18; + * + * @return Whether the foo field is set. */ boolean hasFoo(); @@ -262,6 +345,8 @@ public interface FooOrBuilder extends * * * optional .org.apache.avro.protobuf.multiplefiles.Foo foo = 18; + * + * @return The foo. */ org.apache.avro.protobuf.multiplefiles.Foo getFoo(); @@ -280,6 +365,8 @@ public interface FooOrBuilder extends * * * optional .google.protobuf.Timestamp timestamp = 21; + * + * @return Whether the timestamp field is set. */ boolean hasTimestamp(); @@ -289,6 +376,8 @@ public interface FooOrBuilder extends * * * optional .google.protobuf.Timestamp timestamp = 21; + * + * @return The timestamp. */ com.google.protobuf.Timestamp getTimestamp(); diff --git a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/M.java b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/M.java index 13e41158039..89bdaa363da 100644 --- a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/M.java +++ b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/M.java @@ -1,6 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: src/test/protobuf/test_multiple_files.proto +// Protobuf Java Version: 4.26.1 package org.apache.avro.protobuf.multiplefiles; /** @@ -10,63 +11,30 @@ * * Protobuf type {@code org.apache.avro.protobuf.multiplefiles.M} */ -public final class M extends com.google.protobuf.GeneratedMessageV3 implements +public final class M extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:org.apache.avro.protobuf.multiplefiles.M) MOrBuilder { private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */ 4, /* minor= */ 26, /* patch= */ 1, + /* suffix= */ "", M.class.getName()); + } // Use M.newBuilder() to construct. - private M(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private M(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private M() { } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private M(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; - 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.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_M_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_M_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.multiplefiles.M.class, org.apache.avro.protobuf.multiplefiles.M.Builder.class); @@ -81,6 +49,11 @@ public enum N implements com.google.protobuf.ProtocolMessageEnum { */ A(1),; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */ 4, /* minor= */ 26, /* patch= */ 1, + /* suffix= */ "", N.class.getName()); + } /** * A = 1; */ @@ -91,6 +64,8 @@ public final int getNumber() { } /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated @@ -98,6 +73,10 @@ public static N valueOf(int value) { return forNumber(value); } + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ public static N forNumber(int value) { switch (value) { case 1: @@ -163,7 +142,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -173,7 +152,7 @@ public int getSerializedSize() { return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -188,9 +167,9 @@ public boolean equals(final java.lang.Object obj) { } org.apache.avro.protobuf.multiplefiles.M other = (org.apache.avro.protobuf.multiplefiles.M) obj; - boolean result = true; - result = result && unknownFields.equals(other.unknownFields); - return result; + if (!getUnknownFields().equals(other.getUnknownFields())) + return false; + return true; } @java.lang.Override @@ -200,7 +179,7 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -240,32 +219,32 @@ public static org.apache.avro.protobuf.multiplefiles.M parseFrom(byte[] data, public static org.apache.avro.protobuf.multiplefiles.M parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static org.apache.avro.protobuf.multiplefiles.M parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); } public static org.apache.avro.protobuf.multiplefiles.M parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static org.apache.avro.protobuf.multiplefiles.M parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static org.apache.avro.protobuf.multiplefiles.M parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static org.apache.avro.protobuf.multiplefiles.M parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override @@ -287,7 +266,7 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } @@ -299,7 +278,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code org.apache.avro.protobuf.multiplefiles.M} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:org.apache.avro.protobuf.multiplefiles.M) org.apache.avro.protobuf.multiplefiles.MOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -307,7 +286,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.multiplefiles.TestMultipleFiles.internal_static_org_apache_avro_protobuf_multiplefiles_M_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.multiplefiles.M.class, org.apache.avro.protobuf.multiplefiles.M.Builder.class); @@ -315,17 +294,12 @@ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetF // Construct using org.apache.avro.protobuf.multiplefiles.M.newBuilder() private Builder() { - maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - } } @java.lang.Override @@ -360,37 +334,6 @@ public org.apache.avro.protobuf.multiplefiles.M buildPartial() { return result; } - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - - @java.lang.Override - public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.apache.avro.protobuf.multiplefiles.M) { @@ -404,7 +347,7 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(org.apache.avro.protobuf.multiplefiles.M other) { if (other == org.apache.avro.protobuf.multiplefiles.M.getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -417,30 +360,33 @@ public final boolean isInitialized() { @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.apache.avro.protobuf.multiplefiles.M parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + 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) { - parsedMessage = (org.apache.avro.protobuf.multiplefiles.M) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally 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.avro.protobuf.multiplefiles.M) } @@ -454,13 +400,22 @@ public static org.apache.avro.protobuf.multiplefiles.M getDefaultInstance() { return DEFAULT_INSTANCE; } - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public M parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new M(input, extensionRegistry); + 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(); } }; diff --git a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/MOrBuilder.java b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/MOrBuilder.java index 9694ec20dfb..d98ffa9f4ba 100644 --- a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/MOrBuilder.java +++ b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/MOrBuilder.java @@ -1,6 +1,7 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: src/test/protobuf/test_multiple_files.proto +// Protobuf Java Version: 4.26.1 package org.apache.avro.protobuf.multiplefiles; public interface MOrBuilder extends diff --git a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/TestMultipleFiles.java b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/TestMultipleFiles.java index 879d34f4f2a..c783860c7c7 100644 --- a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/TestMultipleFiles.java +++ b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/multiplefiles/TestMultipleFiles.java @@ -1,5 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: src/test/protobuf/test_multiple_files.proto +// Protobuf Java Version: 4.26.1 package org.apache.avro.protobuf.multiplefiles; @@ -7,6 +8,12 @@ public final class TestMultipleFiles { private TestMultipleFiles() { } + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */ 4, /* minor= */ 26, /* patch= */ 1, + /* suffix= */ "", TestMultipleFiles.class.getName()); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { } @@ -15,9 +22,9 @@ public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry r } static final com.google.protobuf.Descriptors.Descriptor internal_static_org_apache_avro_protobuf_multiplefiles_Foo_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_org_apache_avro_protobuf_multiplefiles_Foo_fieldAccessorTable; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_org_apache_avro_protobuf_multiplefiles_Foo_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_org_apache_avro_protobuf_multiplefiles_M_descriptor; - static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_org_apache_avro_protobuf_multiplefiles_M_fieldAccessorTable; + static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_org_apache_avro_protobuf_multiplefiles_M_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -41,25 +48,18 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "obuf.multiplefiles.Foo\022-\n\ttimestamp\030\025 \001(" + "\0132\032.google.protobuf.Timestamp\"\017\n\001M\"\n\n\001N\022" + "\005\n\001A\020\001*\030\n\001A\022\005\n\001X\020\001\022\005\n\001Y\020\002\022\005\n\001Z\020\003B\002P\001" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.TimestampProto.getDescriptor(), }, - assigner); + descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.TimestampProto.getDescriptor(), }); internal_static_org_apache_avro_protobuf_multiplefiles_Foo_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_org_apache_avro_protobuf_multiplefiles_Foo_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_apache_avro_protobuf_multiplefiles_Foo_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_apache_avro_protobuf_multiplefiles_Foo_descriptor, new java.lang.String[] { "Int32", "Int64", "Uint32", "Uint64", "Sint32", "Sint64", "Fixed32", "Fixed64", "Sfixed32", "Sfixed64", "Float", "Double", "Bool", "String", "Bytes", "Enum", "IntArray", "FooArray", "Syms", "Foo", "Timestamp", }); internal_static_org_apache_avro_protobuf_multiplefiles_M_descriptor = getDescriptor().getMessageTypes().get(1); - internal_static_org_apache_avro_protobuf_multiplefiles_M_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_apache_avro_protobuf_multiplefiles_M_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_apache_avro_protobuf_multiplefiles_M_descriptor, new java.lang.String[] {}); + descriptor.resolveAllFeaturesImmutable(); com.google.protobuf.TimestampProto.getDescriptor(); } diff --git a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/Test.java b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/Test.java index 3483a453ccd..a90594355cd 100644 --- a/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/Test.java +++ b/lang/java/protobuf/src/test/java/org/apache/avro/protobuf/noopt/Test.java @@ -1,5 +1,6 @@ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: src/test/protobuf/test.proto +// Protobuf Java Version: 4.26.1 package org.apache.avro.protobuf.noopt; @@ -7,6 +8,12 @@ public final class Test { private Test() { } + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */ 4, /* minor= */ 26, /* patch= */ 1, + /* suffix= */ "", Test.class.getName()); + } + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) { } @@ -35,6 +42,11 @@ public enum A implements com.google.protobuf.ProtocolMessageEnum { */ Z(3),; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */ 4, /* minor= */ 26, /* patch= */ 1, + /* suffix= */ "", A.class.getName()); + } /** * X = 1; */ @@ -53,6 +65,8 @@ public final int getNumber() { } /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated @@ -60,6 +74,10 @@ public static A valueOf(int value) { return forNumber(value); } + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ public static A forNumber(int value) { switch (value) { case 1: @@ -123,6 +141,8 @@ public interface FooOrBuilder extends * * * required int32 int32 = 1; + * + * @return Whether the int32 field is set. */ boolean hasInt32(); @@ -132,161 +152,225 @@ public interface FooOrBuilder extends * * * required int32 int32 = 1; + * + * @return The int32. */ int getInt32(); /** * optional int64 int64 = 2; + * + * @return Whether the int64 field is set. */ boolean hasInt64(); /** * optional int64 int64 = 2; + * + * @return The int64. */ long getInt64(); /** * optional uint32 uint32 = 3; + * + * @return Whether the uint32 field is set. */ boolean hasUint32(); /** * optional uint32 uint32 = 3; + * + * @return The uint32. */ int getUint32(); /** * optional uint64 uint64 = 4; + * + * @return Whether the uint64 field is set. */ boolean hasUint64(); /** * optional uint64 uint64 = 4; + * + * @return The uint64. */ long getUint64(); /** * optional sint32 sint32 = 5; + * + * @return Whether the sint32 field is set. */ boolean hasSint32(); /** * optional sint32 sint32 = 5; + * + * @return The sint32. */ int getSint32(); /** * optional sint64 sint64 = 6; + * + * @return Whether the sint64 field is set. */ boolean hasSint64(); /** * optional sint64 sint64 = 6; + * + * @return The sint64. */ long getSint64(); /** * optional fixed32 fixed32 = 7; + * + * @return Whether the fixed32 field is set. */ boolean hasFixed32(); /** * optional fixed32 fixed32 = 7; + * + * @return The fixed32. */ int getFixed32(); /** * optional fixed64 fixed64 = 8; + * + * @return Whether the fixed64 field is set. */ boolean hasFixed64(); /** * optional fixed64 fixed64 = 8; + * + * @return The fixed64. */ long getFixed64(); /** * optional sfixed32 sfixed32 = 9; + * + * @return Whether the sfixed32 field is set. */ boolean hasSfixed32(); /** * optional sfixed32 sfixed32 = 9; + * + * @return The sfixed32. */ int getSfixed32(); /** * optional sfixed64 sfixed64 = 10; + * + * @return Whether the sfixed64 field is set. */ boolean hasSfixed64(); /** * optional sfixed64 sfixed64 = 10; + * + * @return The sfixed64. */ long getSfixed64(); /** * optional float float = 11; + * + * @return Whether the float field is set. */ boolean hasFloat(); /** * optional float float = 11; + * + * @return The float. */ float getFloat(); /** * optional double double = 12; + * + * @return Whether the double field is set. */ boolean hasDouble(); /** * optional double double = 12; + * + * @return The double. */ double getDouble(); /** * optional bool bool = 13; + * + * @return Whether the bool field is set. */ boolean hasBool(); /** * optional bool bool = 13; + * + * @return The bool. */ boolean getBool(); /** * optional string string = 14; + * + * @return Whether the string field is set. */ boolean hasString(); /** * optional string string = 14; + * + * @return The string. */ java.lang.String getString(); /** * optional string string = 14; + * + * @return The bytes for string. */ com.google.protobuf.ByteString getStringBytes(); /** * optional bytes bytes = 15; + * + * @return Whether the bytes field is set. */ boolean hasBytes(); /** * optional bytes bytes = 15; + * + * @return The bytes. */ com.google.protobuf.ByteString getBytes(); /** * optional .org.apache.avro.protobuf.noopt.A enum = 16 [default = Z]; + * + * @return Whether the enum field is set. */ boolean hasEnum(); /** * optional .org.apache.avro.protobuf.noopt.A enum = 16 [default = Z]; + * + * @return The enum. */ org.apache.avro.protobuf.noopt.Test.A getEnum(); @@ -296,6 +380,8 @@ public interface FooOrBuilder extends * * * repeated int32 intArray = 17; + * + * @return A list containing the intArray. */ java.util.List getIntArrayList(); @@ -305,6 +391,8 @@ public interface FooOrBuilder extends * * * repeated int32 intArray = 17; + * + * @return The count of intArray. */ int getIntArrayCount(); @@ -314,6 +402,9 @@ public interface FooOrBuilder extends * * * repeated int32 intArray = 17; + * + * @param index The index of the element to return. + * @return The intArray at the given index. */ int getIntArray(int index); @@ -344,16 +435,23 @@ public interface FooOrBuilder extends /** * repeated .org.apache.avro.protobuf.noopt.A syms = 19; + * + * @return A list containing the syms. */ java.util.List getSymsList(); /** * repeated .org.apache.avro.protobuf.noopt.A syms = 19; + * + * @return The count of syms. */ int getSymsCount(); /** * repeated .org.apache.avro.protobuf.noopt.A syms = 19; + * + * @param index The index of the element to return. + * @return The syms at the given index. */ org.apache.avro.protobuf.noopt.Test.A getSyms(int index); @@ -363,6 +461,8 @@ public interface FooOrBuilder extends * * * optional .org.apache.avro.protobuf.noopt.Foo foo = 18; + * + * @return Whether the foo field is set. */ boolean hasFoo(); @@ -372,6 +472,8 @@ public interface FooOrBuilder extends * * * optional .org.apache.avro.protobuf.noopt.Foo foo = 18; + * + * @return The foo. */ org.apache.avro.protobuf.noopt.Test.Foo getFoo(); @@ -390,6 +492,8 @@ public interface FooOrBuilder extends * * * optional .google.protobuf.Timestamp timestamp = 21; + * + * @return Whether the timestamp field is set. */ boolean hasTimestamp(); @@ -399,6 +503,8 @@ public interface FooOrBuilder extends * * * optional .google.protobuf.Timestamp timestamp = 21; + * + * @return The timestamp. */ com.google.protobuf.Timestamp getTimestamp(); @@ -415,270 +521,36 @@ public interface FooOrBuilder extends /** * Protobuf type {@code org.apache.avro.protobuf.noopt.Foo} */ - public static final class Foo extends com.google.protobuf.GeneratedMessageV3 implements + public static final class Foo extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:org.apache.avro.protobuf.noopt.Foo) FooOrBuilder { private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */ 4, /* minor= */ 26, /* patch= */ 1, + /* suffix= */ "", Foo.class.getName()); + } // Use Foo.newBuilder() to construct. - private Foo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private Foo(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private Foo() { - int32_ = 0; - int64_ = 0L; - uint32_ = 0; - uint64_ = 0L; - sint32_ = 0; - sint64_ = 0L; - fixed32_ = 0; - fixed64_ = 0L; - sfixed32_ = 0; - sfixed64_ = 0L; - float_ = 0F; - double_ = 0D; - bool_ = false; string_ = ""; bytes_ = com.google.protobuf.ByteString.EMPTY; enum_ = 3; - intArray_ = java.util.Collections.emptyList(); + intArray_ = emptyIntList(); fooArray_ = java.util.Collections.emptyList(); syms_ = java.util.Collections.emptyList(); } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private Foo(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: { - bitField0_ |= 0x00000001; - int32_ = input.readInt32(); - break; - } - case 16: { - bitField0_ |= 0x00000002; - int64_ = input.readInt64(); - break; - } - case 24: { - bitField0_ |= 0x00000004; - uint32_ = input.readUInt32(); - break; - } - case 32: { - bitField0_ |= 0x00000008; - uint64_ = input.readUInt64(); - break; - } - case 40: { - bitField0_ |= 0x00000010; - sint32_ = input.readSInt32(); - break; - } - case 48: { - bitField0_ |= 0x00000020; - sint64_ = input.readSInt64(); - break; - } - case 61: { - bitField0_ |= 0x00000040; - fixed32_ = input.readFixed32(); - break; - } - case 65: { - bitField0_ |= 0x00000080; - fixed64_ = input.readFixed64(); - break; - } - case 77: { - bitField0_ |= 0x00000100; - sfixed32_ = input.readSFixed32(); - break; - } - case 81: { - bitField0_ |= 0x00000200; - sfixed64_ = input.readSFixed64(); - break; - } - case 93: { - bitField0_ |= 0x00000400; - float_ = input.readFloat(); - break; - } - case 97: { - bitField0_ |= 0x00000800; - double_ = input.readDouble(); - break; - } - case 104: { - bitField0_ |= 0x00001000; - bool_ = input.readBool(); - break; - } - case 114: { - com.google.protobuf.ByteString bs = input.readBytes(); - bitField0_ |= 0x00002000; - string_ = bs; - break; - } - case 122: { - bitField0_ |= 0x00004000; - bytes_ = input.readBytes(); - break; - } - case 128: { - int rawValue = input.readEnum(); - @SuppressWarnings("deprecation") - org.apache.avro.protobuf.noopt.Test.A value = org.apache.avro.protobuf.noopt.Test.A.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(16, rawValue); - } else { - bitField0_ |= 0x00008000; - enum_ = rawValue; - } - break; - } - case 136: { - if (!((mutable_bitField0_ & 0x00010000) == 0x00010000)) { - intArray_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00010000; - } - intArray_.add(input.readInt32()); - break; - } - case 138: { - int length = input.readRawVarint32(); - int limit = input.pushLimit(length); - if (!((mutable_bitField0_ & 0x00010000) == 0x00010000) && input.getBytesUntilLimit() > 0) { - intArray_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00010000; - } - while (input.getBytesUntilLimit() > 0) { - intArray_.add(input.readInt32()); - } - input.popLimit(limit); - break; - } - case 146: { - org.apache.avro.protobuf.noopt.Test.Foo.Builder subBuilder = null; - if (((bitField0_ & 0x00010000) == 0x00010000)) { - subBuilder = foo_.toBuilder(); - } - foo_ = input.readMessage(org.apache.avro.protobuf.noopt.Test.Foo.PARSER, extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(foo_); - foo_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00010000; - break; - } - case 152: { - int rawValue = input.readEnum(); - @SuppressWarnings("deprecation") - org.apache.avro.protobuf.noopt.Test.A value = org.apache.avro.protobuf.noopt.Test.A.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(19, rawValue); - } else { - if (!((mutable_bitField0_ & 0x00040000) == 0x00040000)) { - syms_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00040000; - } - syms_.add(rawValue); - } - break; - } - case 154: { - int length = input.readRawVarint32(); - int oldLimit = input.pushLimit(length); - while (input.getBytesUntilLimit() > 0) { - int rawValue = input.readEnum(); - @SuppressWarnings("deprecation") - org.apache.avro.protobuf.noopt.Test.A value = org.apache.avro.protobuf.noopt.Test.A.valueOf(rawValue); - if (value == null) { - unknownFields.mergeVarintField(19, rawValue); - } else { - if (!((mutable_bitField0_ & 0x00040000) == 0x00040000)) { - syms_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00040000; - } - syms_.add(rawValue); - } - } - input.popLimit(oldLimit); - break; - } - case 162: { - if (!((mutable_bitField0_ & 0x00020000) == 0x00020000)) { - fooArray_ = new java.util.ArrayList(); - mutable_bitField0_ |= 0x00020000; - } - fooArray_.add(input.readMessage(org.apache.avro.protobuf.noopt.Test.Foo.PARSER, extensionRegistry)); - break; - } - case 170: { - com.google.protobuf.Timestamp.Builder subBuilder = null; - if (((bitField0_ & 0x00020000) == 0x00020000)) { - subBuilder = timestamp_.toBuilder(); - } - timestamp_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); - if (subBuilder != null) { - subBuilder.mergeFrom(timestamp_); - timestamp_ = subBuilder.buildPartial(); - } - bitField0_ |= 0x00020000; - 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 { - if (((mutable_bitField0_ & 0x00010000) == 0x00010000)) { - intArray_ = java.util.Collections.unmodifiableList(intArray_); - } - if (((mutable_bitField0_ & 0x00040000) == 0x00040000)) { - syms_ = java.util.Collections.unmodifiableList(syms_); - } - if (((mutable_bitField0_ & 0x00020000) == 0x00020000)) { - fooArray_ = java.util.Collections.unmodifiableList(fooArray_); - } - this.unknownFields = unknownFields.build(); - makeExtensionsImmutable(); - } - } - public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_Foo_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_Foo_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.Test.Foo.class, org.apache.avro.protobuf.noopt.Test.Foo.Builder.class); @@ -686,7 +558,7 @@ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetF private int bitField0_; public static final int INT32_FIELD_NUMBER = 1; - private int int32_; + private int int32_ = 0; /** *
@@ -694,9 +566,12 @@ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetF
      * 
* * required int32 int32 = 1; + * + * @return Whether the int32 field is set. */ + @java.lang.Override public boolean hasInt32() { - return ((bitField0_ & 0x00000001) == 0x00000001); + return ((bitField0_ & 0x00000001) != 0); } /** @@ -705,228 +580,310 @@ public boolean hasInt32() { * * * required int32 int32 = 1; + * + * @return The int32. */ + @java.lang.Override public int getInt32() { return int32_; } public static final int INT64_FIELD_NUMBER = 2; - private long int64_; + private long int64_ = 0L; /** * optional int64 int64 = 2; + * + * @return Whether the int64 field is set. */ + @java.lang.Override public boolean hasInt64() { - return ((bitField0_ & 0x00000002) == 0x00000002); + return ((bitField0_ & 0x00000002) != 0); } /** * optional int64 int64 = 2; + * + * @return The int64. */ + @java.lang.Override public long getInt64() { return int64_; } public static final int UINT32_FIELD_NUMBER = 3; - private int uint32_; + private int uint32_ = 0; /** * optional uint32 uint32 = 3; + * + * @return Whether the uint32 field is set. */ + @java.lang.Override public boolean hasUint32() { - return ((bitField0_ & 0x00000004) == 0x00000004); + return ((bitField0_ & 0x00000004) != 0); } /** * optional uint32 uint32 = 3; + * + * @return The uint32. */ + @java.lang.Override public int getUint32() { return uint32_; } public static final int UINT64_FIELD_NUMBER = 4; - private long uint64_; + private long uint64_ = 0L; /** * optional uint64 uint64 = 4; + * + * @return Whether the uint64 field is set. */ + @java.lang.Override public boolean hasUint64() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000008) != 0); } /** * optional uint64 uint64 = 4; + * + * @return The uint64. */ + @java.lang.Override public long getUint64() { return uint64_; } public static final int SINT32_FIELD_NUMBER = 5; - private int sint32_; + private int sint32_ = 0; /** * optional sint32 sint32 = 5; + * + * @return Whether the sint32 field is set. */ + @java.lang.Override public boolean hasSint32() { - return ((bitField0_ & 0x00000010) == 0x00000010); + return ((bitField0_ & 0x00000010) != 0); } /** * optional sint32 sint32 = 5; + * + * @return The sint32. */ + @java.lang.Override public int getSint32() { return sint32_; } public static final int SINT64_FIELD_NUMBER = 6; - private long sint64_; + private long sint64_ = 0L; /** * optional sint64 sint64 = 6; + * + * @return Whether the sint64 field is set. */ + @java.lang.Override public boolean hasSint64() { - return ((bitField0_ & 0x00000020) == 0x00000020); + return ((bitField0_ & 0x00000020) != 0); } /** * optional sint64 sint64 = 6; + * + * @return The sint64. */ + @java.lang.Override public long getSint64() { return sint64_; } public static final int FIXED32_FIELD_NUMBER = 7; - private int fixed32_; + private int fixed32_ = 0; /** * optional fixed32 fixed32 = 7; + * + * @return Whether the fixed32 field is set. */ + @java.lang.Override public boolean hasFixed32() { - return ((bitField0_ & 0x00000040) == 0x00000040); + return ((bitField0_ & 0x00000040) != 0); } /** * optional fixed32 fixed32 = 7; + * + * @return The fixed32. */ + @java.lang.Override public int getFixed32() { return fixed32_; } public static final int FIXED64_FIELD_NUMBER = 8; - private long fixed64_; + private long fixed64_ = 0L; /** * optional fixed64 fixed64 = 8; + * + * @return Whether the fixed64 field is set. */ + @java.lang.Override public boolean hasFixed64() { - return ((bitField0_ & 0x00000080) == 0x00000080); + return ((bitField0_ & 0x00000080) != 0); } /** * optional fixed64 fixed64 = 8; + * + * @return The fixed64. */ + @java.lang.Override public long getFixed64() { return fixed64_; } public static final int SFIXED32_FIELD_NUMBER = 9; - private int sfixed32_; + private int sfixed32_ = 0; /** * optional sfixed32 sfixed32 = 9; + * + * @return Whether the sfixed32 field is set. */ + @java.lang.Override public boolean hasSfixed32() { - return ((bitField0_ & 0x00000100) == 0x00000100); + return ((bitField0_ & 0x00000100) != 0); } /** * optional sfixed32 sfixed32 = 9; + * + * @return The sfixed32. */ + @java.lang.Override public int getSfixed32() { return sfixed32_; } public static final int SFIXED64_FIELD_NUMBER = 10; - private long sfixed64_; + private long sfixed64_ = 0L; /** * optional sfixed64 sfixed64 = 10; + * + * @return Whether the sfixed64 field is set. */ + @java.lang.Override public boolean hasSfixed64() { - return ((bitField0_ & 0x00000200) == 0x00000200); + return ((bitField0_ & 0x00000200) != 0); } /** * optional sfixed64 sfixed64 = 10; + * + * @return The sfixed64. */ + @java.lang.Override public long getSfixed64() { return sfixed64_; } public static final int FLOAT_FIELD_NUMBER = 11; - private float float_; + private float float_ = 0F; /** * optional float float = 11; + * + * @return Whether the float field is set. */ + @java.lang.Override public boolean hasFloat() { - return ((bitField0_ & 0x00000400) == 0x00000400); + return ((bitField0_ & 0x00000400) != 0); } /** * optional float float = 11; + * + * @return The float. */ + @java.lang.Override public float getFloat() { return float_; } public static final int DOUBLE_FIELD_NUMBER = 12; - private double double_; + private double double_ = 0D; /** * optional double double = 12; + * + * @return Whether the double field is set. */ + @java.lang.Override public boolean hasDouble() { - return ((bitField0_ & 0x00000800) == 0x00000800); + return ((bitField0_ & 0x00000800) != 0); } /** * optional double double = 12; + * + * @return The double. */ + @java.lang.Override public double getDouble() { return double_; } public static final int BOOL_FIELD_NUMBER = 13; - private boolean bool_; + private boolean bool_ = false; /** * optional bool bool = 13; + * + * @return Whether the bool field is set. */ + @java.lang.Override public boolean hasBool() { - return ((bitField0_ & 0x00001000) == 0x00001000); + return ((bitField0_ & 0x00001000) != 0); } /** * optional bool bool = 13; + * + * @return The bool. */ + @java.lang.Override public boolean getBool() { return bool_; } public static final int STRING_FIELD_NUMBER = 14; - private volatile java.lang.Object string_; + @SuppressWarnings("serial") + private volatile java.lang.Object string_ = ""; /** * optional string string = 14; + * + * @return Whether the string field is set. */ + @java.lang.Override public boolean hasString() { - return ((bitField0_ & 0x00002000) == 0x00002000); + return ((bitField0_ & 0x00002000) != 0); } /** * optional string string = 14; + * + * @return The string. */ + @java.lang.Override public java.lang.String getString() { java.lang.Object ref = string_; if (ref instanceof java.lang.String) { @@ -943,7 +900,10 @@ public java.lang.String getString() { /** * optional string string = 14; + * + * @return The bytes for string. */ + @java.lang.Override public com.google.protobuf.ByteString getStringBytes() { java.lang.Object ref = string_; if (ref instanceof java.lang.String) { @@ -956,43 +916,55 @@ public com.google.protobuf.ByteString getStringBytes() { } public static final int BYTES_FIELD_NUMBER = 15; - private com.google.protobuf.ByteString bytes_; + private com.google.protobuf.ByteString bytes_ = com.google.protobuf.ByteString.EMPTY; /** * optional bytes bytes = 15; + * + * @return Whether the bytes field is set. */ + @java.lang.Override public boolean hasBytes() { - return ((bitField0_ & 0x00004000) == 0x00004000); + return ((bitField0_ & 0x00004000) != 0); } /** * optional bytes bytes = 15; + * + * @return The bytes. */ + @java.lang.Override public com.google.protobuf.ByteString getBytes() { return bytes_; } public static final int ENUM_FIELD_NUMBER = 16; - private int enum_; + private int enum_ = 3; /** * optional .org.apache.avro.protobuf.noopt.A enum = 16 [default = Z]; + * + * @return Whether the enum field is set. */ + @java.lang.Override public boolean hasEnum() { - return ((bitField0_ & 0x00008000) == 0x00008000); + return ((bitField0_ & 0x00008000) != 0); } /** * optional .org.apache.avro.protobuf.noopt.A enum = 16 [default = Z]; + * + * @return The enum. */ + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.A getEnum() { - @SuppressWarnings("deprecation") - org.apache.avro.protobuf.noopt.Test.A result = org.apache.avro.protobuf.noopt.Test.A.valueOf(enum_); + org.apache.avro.protobuf.noopt.Test.A result = org.apache.avro.protobuf.noopt.Test.A.forNumber(enum_); return result == null ? org.apache.avro.protobuf.noopt.Test.A.Z : result; } public static final int INTARRAY_FIELD_NUMBER = 17; - private java.util.List intArray_; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList intArray_ = emptyIntList(); /** *
@@ -1000,7 +972,10 @@ public org.apache.avro.protobuf.noopt.Test.A getEnum() {
      * 
* * repeated int32 intArray = 17; + * + * @return A list containing the intArray. */ + @java.lang.Override public java.util.List getIntArrayList() { return intArray_; } @@ -1011,6 +986,8 @@ public java.util.List getIntArrayList() { * * * repeated int32 intArray = 17; + * + * @return The count of intArray. */ public int getIntArrayCount() { return intArray_.size(); @@ -1022,17 +999,22 @@ public int getIntArrayCount() { * * * repeated int32 intArray = 17; + * + * @param index The index of the element to return. + * @return The intArray at the given index. */ public int getIntArray(int index) { - return intArray_.get(index); + return intArray_.getInt(index); } public static final int FOOARRAY_FIELD_NUMBER = 20; + @SuppressWarnings("serial") private java.util.List fooArray_; /** * repeated .org.apache.avro.protobuf.noopt.Foo fooArray = 20; */ + @java.lang.Override public java.util.List getFooArrayList() { return fooArray_; } @@ -1040,6 +1022,7 @@ public java.util.List getFooArrayList() /** * repeated .org.apache.avro.protobuf.noopt.Foo fooArray = 20; */ + @java.lang.Override public java.util.List getFooArrayOrBuilderList() { return fooArray_; } @@ -1047,6 +1030,7 @@ public java.util.Listrepeated .org.apache.avro.protobuf.noopt.Foo fooArray = 20; */ + @java.lang.Override public int getFooArrayCount() { return fooArray_.size(); } @@ -1054,6 +1038,7 @@ public int getFooArrayCount() { /** * repeated .org.apache.avro.protobuf.noopt.Foo fooArray = 20; */ + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.Foo getFooArray(int index) { return fooArray_.get(index); } @@ -1061,23 +1046,27 @@ public org.apache.avro.protobuf.noopt.Test.Foo getFooArray(int index) { /** * repeated .org.apache.avro.protobuf.noopt.Foo fooArray = 20; */ + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.FooOrBuilder getFooArrayOrBuilder(int index) { return fooArray_.get(index); } public static final int SYMS_FIELD_NUMBER = 19; + @SuppressWarnings("serial") private java.util.List syms_; private static final com.google.protobuf.Internal.ListAdapter.Converter syms_converter_ = new com.google.protobuf.Internal.ListAdapter.Converter() { public org.apache.avro.protobuf.noopt.Test.A convert(java.lang.Integer from) { - @SuppressWarnings("deprecation") - org.apache.avro.protobuf.noopt.Test.A result = org.apache.avro.protobuf.noopt.Test.A.valueOf(from); + org.apache.avro.protobuf.noopt.Test.A result = org.apache.avro.protobuf.noopt.Test.A.forNumber(from); return result == null ? org.apache.avro.protobuf.noopt.Test.A.X : result; } }; /** * repeated .org.apache.avro.protobuf.noopt.A syms = 19; + * + * @return A list containing the syms. */ + @java.lang.Override public java.util.List getSymsList() { return new com.google.protobuf.Internal.ListAdapter( syms_, syms_converter_); @@ -1085,14 +1074,21 @@ public java.util.List getSymsList() { /** * repeated .org.apache.avro.protobuf.noopt.A syms = 19; + * + * @return The count of syms. */ + @java.lang.Override public int getSymsCount() { return syms_.size(); } /** * repeated .org.apache.avro.protobuf.noopt.A syms = 19; + * + * @param index The index of the element to return. + * @return The syms at the given index. */ + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.A getSyms(int index) { return syms_converter_.convert(syms_.get(index)); } @@ -1106,9 +1102,12 @@ public org.apache.avro.protobuf.noopt.Test.A getSyms(int index) { * * * optional .org.apache.avro.protobuf.noopt.Foo foo = 18; + * + * @return Whether the foo field is set. */ + @java.lang.Override public boolean hasFoo() { - return ((bitField0_ & 0x00010000) == 0x00010000); + return ((bitField0_ & 0x00010000) != 0); } /** @@ -1117,7 +1116,10 @@ public boolean hasFoo() { * * * optional .org.apache.avro.protobuf.noopt.Foo foo = 18; + * + * @return The foo. */ + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.Foo getFoo() { return foo_ == null ? org.apache.avro.protobuf.noopt.Test.Foo.getDefaultInstance() : foo_; } @@ -1129,6 +1131,7 @@ public org.apache.avro.protobuf.noopt.Test.Foo getFoo() { * * optional .org.apache.avro.protobuf.noopt.Foo foo = 18; */ + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.FooOrBuilder getFooOrBuilder() { return foo_ == null ? org.apache.avro.protobuf.noopt.Test.Foo.getDefaultInstance() : foo_; } @@ -1142,9 +1145,12 @@ public org.apache.avro.protobuf.noopt.Test.FooOrBuilder getFooOrBuilder() { * * * optional .google.protobuf.Timestamp timestamp = 21; + * + * @return Whether the timestamp field is set. */ + @java.lang.Override public boolean hasTimestamp() { - return ((bitField0_ & 0x00020000) == 0x00020000); + return ((bitField0_ & 0x00020000) != 0); } /** @@ -1153,7 +1159,10 @@ public boolean hasTimestamp() { * * * optional .google.protobuf.Timestamp timestamp = 21; + * + * @return The timestamp. */ + @java.lang.Override public com.google.protobuf.Timestamp getTimestamp() { return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; } @@ -1165,6 +1174,7 @@ public com.google.protobuf.Timestamp getTimestamp() { * * optional .google.protobuf.Timestamp timestamp = 21; */ + @java.lang.Override public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { return timestamp_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : timestamp_; } @@ -1201,58 +1211,58 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (((bitField0_ & 0x00000001) != 0)) { output.writeInt32(1, int32_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (((bitField0_ & 0x00000002) != 0)) { output.writeInt64(2, int64_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (((bitField0_ & 0x00000004) != 0)) { output.writeUInt32(3, uint32_); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (((bitField0_ & 0x00000008) != 0)) { output.writeUInt64(4, uint64_); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (((bitField0_ & 0x00000010) != 0)) { output.writeSInt32(5, sint32_); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { + if (((bitField0_ & 0x00000020) != 0)) { output.writeSInt64(6, sint64_); } - if (((bitField0_ & 0x00000040) == 0x00000040)) { + if (((bitField0_ & 0x00000040) != 0)) { output.writeFixed32(7, fixed32_); } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (((bitField0_ & 0x00000080) != 0)) { output.writeFixed64(8, fixed64_); } - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (((bitField0_ & 0x00000100) != 0)) { output.writeSFixed32(9, sfixed32_); } - if (((bitField0_ & 0x00000200) == 0x00000200)) { + if (((bitField0_ & 0x00000200) != 0)) { output.writeSFixed64(10, sfixed64_); } - if (((bitField0_ & 0x00000400) == 0x00000400)) { + if (((bitField0_ & 0x00000400) != 0)) { output.writeFloat(11, float_); } - if (((bitField0_ & 0x00000800) == 0x00000800)) { + if (((bitField0_ & 0x00000800) != 0)) { output.writeDouble(12, double_); } - if (((bitField0_ & 0x00001000) == 0x00001000)) { + if (((bitField0_ & 0x00001000) != 0)) { output.writeBool(13, bool_); } - if (((bitField0_ & 0x00002000) == 0x00002000)) { - com.google.protobuf.GeneratedMessageV3.writeString(output, 14, string_); + if (((bitField0_ & 0x00002000) != 0)) { + com.google.protobuf.GeneratedMessage.writeString(output, 14, string_); } - if (((bitField0_ & 0x00004000) == 0x00004000)) { + if (((bitField0_ & 0x00004000) != 0)) { output.writeBytes(15, bytes_); } - if (((bitField0_ & 0x00008000) == 0x00008000)) { + if (((bitField0_ & 0x00008000) != 0)) { output.writeEnum(16, enum_); } for (int i = 0; i < intArray_.size(); i++) { - output.writeInt32(17, intArray_.get(i)); + output.writeInt32(17, intArray_.getInt(i)); } - if (((bitField0_ & 0x00010000) == 0x00010000)) { + if (((bitField0_ & 0x00010000) != 0)) { output.writeMessage(18, getFoo()); } for (int i = 0; i < syms_.size(); i++) { @@ -1261,10 +1271,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io for (int i = 0; i < fooArray_.size(); i++) { output.writeMessage(20, fooArray_.get(i)); } - if (((bitField0_ & 0x00020000) == 0x00020000)) { + if (((bitField0_ & 0x00020000) != 0)) { output.writeMessage(21, getTimestamp()); } - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -1274,63 +1284,63 @@ public int getSerializedSize() { return size; size = 0; - if (((bitField0_ & 0x00000001) == 0x00000001)) { + if (((bitField0_ & 0x00000001) != 0)) { size += com.google.protobuf.CodedOutputStream.computeInt32Size(1, int32_); } - if (((bitField0_ & 0x00000002) == 0x00000002)) { + if (((bitField0_ & 0x00000002) != 0)) { size += com.google.protobuf.CodedOutputStream.computeInt64Size(2, int64_); } - if (((bitField0_ & 0x00000004) == 0x00000004)) { + if (((bitField0_ & 0x00000004) != 0)) { size += com.google.protobuf.CodedOutputStream.computeUInt32Size(3, uint32_); } - if (((bitField0_ & 0x00000008) == 0x00000008)) { + if (((bitField0_ & 0x00000008) != 0)) { size += com.google.protobuf.CodedOutputStream.computeUInt64Size(4, uint64_); } - if (((bitField0_ & 0x00000010) == 0x00000010)) { + if (((bitField0_ & 0x00000010) != 0)) { size += com.google.protobuf.CodedOutputStream.computeSInt32Size(5, sint32_); } - if (((bitField0_ & 0x00000020) == 0x00000020)) { + if (((bitField0_ & 0x00000020) != 0)) { size += com.google.protobuf.CodedOutputStream.computeSInt64Size(6, sint64_); } - if (((bitField0_ & 0x00000040) == 0x00000040)) { + if (((bitField0_ & 0x00000040) != 0)) { size += com.google.protobuf.CodedOutputStream.computeFixed32Size(7, fixed32_); } - if (((bitField0_ & 0x00000080) == 0x00000080)) { + if (((bitField0_ & 0x00000080) != 0)) { size += com.google.protobuf.CodedOutputStream.computeFixed64Size(8, fixed64_); } - if (((bitField0_ & 0x00000100) == 0x00000100)) { + if (((bitField0_ & 0x00000100) != 0)) { size += com.google.protobuf.CodedOutputStream.computeSFixed32Size(9, sfixed32_); } - if (((bitField0_ & 0x00000200) == 0x00000200)) { + if (((bitField0_ & 0x00000200) != 0)) { size += com.google.protobuf.CodedOutputStream.computeSFixed64Size(10, sfixed64_); } - if (((bitField0_ & 0x00000400) == 0x00000400)) { + if (((bitField0_ & 0x00000400) != 0)) { size += com.google.protobuf.CodedOutputStream.computeFloatSize(11, float_); } - if (((bitField0_ & 0x00000800) == 0x00000800)) { + if (((bitField0_ & 0x00000800) != 0)) { size += com.google.protobuf.CodedOutputStream.computeDoubleSize(12, double_); } - if (((bitField0_ & 0x00001000) == 0x00001000)) { + if (((bitField0_ & 0x00001000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeBoolSize(13, bool_); } - if (((bitField0_ & 0x00002000) == 0x00002000)) { - size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, string_); + if (((bitField0_ & 0x00002000) != 0)) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(14, string_); } - if (((bitField0_ & 0x00004000) == 0x00004000)) { + if (((bitField0_ & 0x00004000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeBytesSize(15, bytes_); } - if (((bitField0_ & 0x00008000) == 0x00008000)) { + if (((bitField0_ & 0x00008000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(16, enum_); } { int dataSize = 0; for (int i = 0; i < intArray_.size(); i++) { - dataSize += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(intArray_.get(i)); + dataSize += com.google.protobuf.CodedOutputStream.computeInt32SizeNoTag(intArray_.getInt(i)); } size += dataSize; size += 2 * getIntArrayList().size(); } - if (((bitField0_ & 0x00010000) == 0x00010000)) { + if (((bitField0_ & 0x00010000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(18, getFoo()); } { @@ -1344,10 +1354,10 @@ public int getSerializedSize() { for (int i = 0; i < fooArray_.size(); i++) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(20, fooArray_.get(i)); } - if (((bitField0_ & 0x00020000) == 0x00020000)) { + if (((bitField0_ & 0x00020000) != 0)) { size += com.google.protobuf.CodedOutputStream.computeMessageSize(21, getTimestamp()); } - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -1362,86 +1372,123 @@ public boolean equals(final java.lang.Object obj) { } org.apache.avro.protobuf.noopt.Test.Foo other = (org.apache.avro.protobuf.noopt.Test.Foo) obj; - boolean result = true; - result = result && (hasInt32() == other.hasInt32()); + if (hasInt32() != other.hasInt32()) + return false; if (hasInt32()) { - result = result && (getInt32() == other.getInt32()); + if (getInt32() != other.getInt32()) + return false; } - result = result && (hasInt64() == other.hasInt64()); + if (hasInt64() != other.hasInt64()) + return false; if (hasInt64()) { - result = result && (getInt64() == other.getInt64()); + if (getInt64() != other.getInt64()) + return false; } - result = result && (hasUint32() == other.hasUint32()); + if (hasUint32() != other.hasUint32()) + return false; if (hasUint32()) { - result = result && (getUint32() == other.getUint32()); + if (getUint32() != other.getUint32()) + return false; } - result = result && (hasUint64() == other.hasUint64()); + if (hasUint64() != other.hasUint64()) + return false; if (hasUint64()) { - result = result && (getUint64() == other.getUint64()); + if (getUint64() != other.getUint64()) + return false; } - result = result && (hasSint32() == other.hasSint32()); + if (hasSint32() != other.hasSint32()) + return false; if (hasSint32()) { - result = result && (getSint32() == other.getSint32()); + if (getSint32() != other.getSint32()) + return false; } - result = result && (hasSint64() == other.hasSint64()); + if (hasSint64() != other.hasSint64()) + return false; if (hasSint64()) { - result = result && (getSint64() == other.getSint64()); + if (getSint64() != other.getSint64()) + return false; } - result = result && (hasFixed32() == other.hasFixed32()); + if (hasFixed32() != other.hasFixed32()) + return false; if (hasFixed32()) { - result = result && (getFixed32() == other.getFixed32()); + if (getFixed32() != other.getFixed32()) + return false; } - result = result && (hasFixed64() == other.hasFixed64()); + if (hasFixed64() != other.hasFixed64()) + return false; if (hasFixed64()) { - result = result && (getFixed64() == other.getFixed64()); + if (getFixed64() != other.getFixed64()) + return false; } - result = result && (hasSfixed32() == other.hasSfixed32()); + if (hasSfixed32() != other.hasSfixed32()) + return false; if (hasSfixed32()) { - result = result && (getSfixed32() == other.getSfixed32()); + if (getSfixed32() != other.getSfixed32()) + return false; } - result = result && (hasSfixed64() == other.hasSfixed64()); + if (hasSfixed64() != other.hasSfixed64()) + return false; if (hasSfixed64()) { - result = result && (getSfixed64() == other.getSfixed64()); + if (getSfixed64() != other.getSfixed64()) + return false; } - result = result && (hasFloat() == other.hasFloat()); + if (hasFloat() != other.hasFloat()) + return false; if (hasFloat()) { - result = result - && (java.lang.Float.floatToIntBits(getFloat()) == java.lang.Float.floatToIntBits(other.getFloat())); + if (java.lang.Float.floatToIntBits(getFloat()) != java.lang.Float.floatToIntBits(other.getFloat())) + return false; } - result = result && (hasDouble() == other.hasDouble()); + if (hasDouble() != other.hasDouble()) + return false; if (hasDouble()) { - result = result - && (java.lang.Double.doubleToLongBits(getDouble()) == java.lang.Double.doubleToLongBits(other.getDouble())); + if (java.lang.Double.doubleToLongBits(getDouble()) != java.lang.Double.doubleToLongBits(other.getDouble())) + return false; } - result = result && (hasBool() == other.hasBool()); + if (hasBool() != other.hasBool()) + return false; if (hasBool()) { - result = result && (getBool() == other.getBool()); + if (getBool() != other.getBool()) + return false; } - result = result && (hasString() == other.hasString()); + if (hasString() != other.hasString()) + return false; if (hasString()) { - result = result && getString().equals(other.getString()); + if (!getString().equals(other.getString())) + return false; } - result = result && (hasBytes() == other.hasBytes()); + if (hasBytes() != other.hasBytes()) + return false; if (hasBytes()) { - result = result && getBytes().equals(other.getBytes()); + if (!getBytes().equals(other.getBytes())) + return false; } - result = result && (hasEnum() == other.hasEnum()); + if (hasEnum() != other.hasEnum()) + return false; if (hasEnum()) { - result = result && enum_ == other.enum_; + if (enum_ != other.enum_) + return false; } - result = result && getIntArrayList().equals(other.getIntArrayList()); - result = result && getFooArrayList().equals(other.getFooArrayList()); - result = result && syms_.equals(other.syms_); - result = result && (hasFoo() == other.hasFoo()); + if (!getIntArrayList().equals(other.getIntArrayList())) + return false; + if (!getFooArrayList().equals(other.getFooArrayList())) + return false; + if (!syms_.equals(other.syms_)) + return false; + if (hasFoo() != other.hasFoo()) + return false; if (hasFoo()) { - result = result && getFoo().equals(other.getFoo()); + if (!getFoo().equals(other.getFoo())) + return false; } - result = result && (hasTimestamp() == other.hasTimestamp()); + if (hasTimestamp() != other.hasTimestamp()) + return false; if (hasTimestamp()) { - result = result && getTimestamp().equals(other.getTimestamp()); + if (!getTimestamp().equals(other.getTimestamp())) + return false; } - result = result && unknownFields.equals(other.unknownFields); - return result; + if (!getUnknownFields().equals(other.getUnknownFields())) + return false; + return true; } @java.lang.Override @@ -1535,7 +1582,7 @@ public int hashCode() { hash = (37 * hash) + TIMESTAMP_FIELD_NUMBER; hash = (53 * hash) + getTimestamp().hashCode(); } - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -1575,32 +1622,32 @@ public static org.apache.avro.protobuf.noopt.Test.Foo parseFrom(byte[] data, public static org.apache.avro.protobuf.noopt.Test.Foo parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static org.apache.avro.protobuf.noopt.Test.Foo parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); } public static org.apache.avro.protobuf.noopt.Test.Foo parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static org.apache.avro.protobuf.noopt.Test.Foo parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static org.apache.avro.protobuf.noopt.Test.Foo parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static org.apache.avro.protobuf.noopt.Test.Foo parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override @@ -1622,7 +1669,7 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } @@ -1630,7 +1677,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build /** * Protobuf type {@code org.apache.avro.protobuf.noopt.Foo} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:org.apache.avro.protobuf.noopt.Foo) org.apache.avro.protobuf.noopt.Test.FooOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -1638,7 +1685,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_Foo_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.Test.Foo.class, org.apache.avro.protobuf.noopt.Test.Foo.Builder.class); @@ -1649,13 +1696,13 @@ private Builder() { maybeForceBuilderInitialization(); } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { + if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) { getFooArrayFieldBuilder(); getFooFieldBuilder(); getTimestampFieldBuilder(); @@ -1665,60 +1712,43 @@ private void maybeForceBuilderInitialization() { @java.lang.Override public Builder clear() { super.clear(); + bitField0_ = 0; int32_ = 0; - bitField0_ = (bitField0_ & ~0x00000001); int64_ = 0L; - bitField0_ = (bitField0_ & ~0x00000002); uint32_ = 0; - bitField0_ = (bitField0_ & ~0x00000004); uint64_ = 0L; - bitField0_ = (bitField0_ & ~0x00000008); sint32_ = 0; - bitField0_ = (bitField0_ & ~0x00000010); sint64_ = 0L; - bitField0_ = (bitField0_ & ~0x00000020); fixed32_ = 0; - bitField0_ = (bitField0_ & ~0x00000040); fixed64_ = 0L; - bitField0_ = (bitField0_ & ~0x00000080); sfixed32_ = 0; - bitField0_ = (bitField0_ & ~0x00000100); sfixed64_ = 0L; - bitField0_ = (bitField0_ & ~0x00000200); float_ = 0F; - bitField0_ = (bitField0_ & ~0x00000400); double_ = 0D; - bitField0_ = (bitField0_ & ~0x00000800); bool_ = false; - bitField0_ = (bitField0_ & ~0x00001000); string_ = ""; - bitField0_ = (bitField0_ & ~0x00002000); bytes_ = com.google.protobuf.ByteString.EMPTY; - bitField0_ = (bitField0_ & ~0x00004000); enum_ = 3; - bitField0_ = (bitField0_ & ~0x00008000); - intArray_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00010000); + intArray_ = emptyIntList(); if (fooArrayBuilder_ == null) { fooArray_ = java.util.Collections.emptyList(); - bitField0_ = (bitField0_ & ~0x00020000); } else { + fooArray_ = null; fooArrayBuilder_.clear(); } + bitField0_ = (bitField0_ & ~0x00020000); syms_ = java.util.Collections.emptyList(); bitField0_ = (bitField0_ & ~0x00040000); - if (fooBuilder_ == null) { - foo_ = null; - } else { - fooBuilder_.clear(); + foo_ = null; + if (fooBuilder_ != null) { + fooBuilder_.dispose(); + fooBuilder_ = null; } - bitField0_ = (bitField0_ & ~0x00080000); - if (timestampBuilder_ == null) { - timestamp_ = null; - } else { - timestampBuilder_.clear(); + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; } - bitField0_ = (bitField0_ & ~0x00100000); return this; } @@ -1744,141 +1774,111 @@ public org.apache.avro.protobuf.noopt.Test.Foo build() { @java.lang.Override public org.apache.avro.protobuf.noopt.Test.Foo buildPartial() { org.apache.avro.protobuf.noopt.Test.Foo result = new org.apache.avro.protobuf.noopt.Test.Foo(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields(org.apache.avro.protobuf.noopt.Test.Foo result) { + if (fooArrayBuilder_ == null) { + if (((bitField0_ & 0x00020000) != 0)) { + fooArray_ = java.util.Collections.unmodifiableList(fooArray_); + bitField0_ = (bitField0_ & ~0x00020000); + } + result.fooArray_ = fooArray_; + } else { + result.fooArray_ = fooArrayBuilder_.build(); + } + if (((bitField0_ & 0x00040000) != 0)) { + syms_ = java.util.Collections.unmodifiableList(syms_); + bitField0_ = (bitField0_ & ~0x00040000); + } + result.syms_ = syms_; + } + + private void buildPartial0(org.apache.avro.protobuf.noopt.Test.Foo result) { int from_bitField0_ = bitField0_; int to_bitField0_ = 0; - if (((from_bitField0_ & 0x00000001) == 0x00000001)) { + if (((from_bitField0_ & 0x00000001) != 0)) { + result.int32_ = int32_; to_bitField0_ |= 0x00000001; } - result.int32_ = int32_; - if (((from_bitField0_ & 0x00000002) == 0x00000002)) { + if (((from_bitField0_ & 0x00000002) != 0)) { + result.int64_ = int64_; to_bitField0_ |= 0x00000002; } - result.int64_ = int64_; - if (((from_bitField0_ & 0x00000004) == 0x00000004)) { + if (((from_bitField0_ & 0x00000004) != 0)) { + result.uint32_ = uint32_; to_bitField0_ |= 0x00000004; } - result.uint32_ = uint32_; - if (((from_bitField0_ & 0x00000008) == 0x00000008)) { + if (((from_bitField0_ & 0x00000008) != 0)) { + result.uint64_ = uint64_; to_bitField0_ |= 0x00000008; } - result.uint64_ = uint64_; - if (((from_bitField0_ & 0x00000010) == 0x00000010)) { + if (((from_bitField0_ & 0x00000010) != 0)) { + result.sint32_ = sint32_; to_bitField0_ |= 0x00000010; } - result.sint32_ = sint32_; - if (((from_bitField0_ & 0x00000020) == 0x00000020)) { + if (((from_bitField0_ & 0x00000020) != 0)) { + result.sint64_ = sint64_; to_bitField0_ |= 0x00000020; } - result.sint64_ = sint64_; - if (((from_bitField0_ & 0x00000040) == 0x00000040)) { + if (((from_bitField0_ & 0x00000040) != 0)) { + result.fixed32_ = fixed32_; to_bitField0_ |= 0x00000040; } - result.fixed32_ = fixed32_; - if (((from_bitField0_ & 0x00000080) == 0x00000080)) { + if (((from_bitField0_ & 0x00000080) != 0)) { + result.fixed64_ = fixed64_; to_bitField0_ |= 0x00000080; } - result.fixed64_ = fixed64_; - if (((from_bitField0_ & 0x00000100) == 0x00000100)) { + if (((from_bitField0_ & 0x00000100) != 0)) { + result.sfixed32_ = sfixed32_; to_bitField0_ |= 0x00000100; } - result.sfixed32_ = sfixed32_; - if (((from_bitField0_ & 0x00000200) == 0x00000200)) { + if (((from_bitField0_ & 0x00000200) != 0)) { + result.sfixed64_ = sfixed64_; to_bitField0_ |= 0x00000200; } - result.sfixed64_ = sfixed64_; - if (((from_bitField0_ & 0x00000400) == 0x00000400)) { + if (((from_bitField0_ & 0x00000400) != 0)) { + result.float_ = float_; to_bitField0_ |= 0x00000400; } - result.float_ = float_; - if (((from_bitField0_ & 0x00000800) == 0x00000800)) { + if (((from_bitField0_ & 0x00000800) != 0)) { + result.double_ = double_; to_bitField0_ |= 0x00000800; } - result.double_ = double_; - if (((from_bitField0_ & 0x00001000) == 0x00001000)) { + if (((from_bitField0_ & 0x00001000) != 0)) { + result.bool_ = bool_; to_bitField0_ |= 0x00001000; } - result.bool_ = bool_; - if (((from_bitField0_ & 0x00002000) == 0x00002000)) { + if (((from_bitField0_ & 0x00002000) != 0)) { + result.string_ = string_; to_bitField0_ |= 0x00002000; } - result.string_ = string_; - if (((from_bitField0_ & 0x00004000) == 0x00004000)) { + if (((from_bitField0_ & 0x00004000) != 0)) { + result.bytes_ = bytes_; to_bitField0_ |= 0x00004000; } - result.bytes_ = bytes_; - if (((from_bitField0_ & 0x00008000) == 0x00008000)) { + if (((from_bitField0_ & 0x00008000) != 0)) { + result.enum_ = enum_; to_bitField0_ |= 0x00008000; } - result.enum_ = enum_; - if (((bitField0_ & 0x00010000) == 0x00010000)) { - intArray_ = java.util.Collections.unmodifiableList(intArray_); - bitField0_ = (bitField0_ & ~0x00010000); + if (((from_bitField0_ & 0x00010000) != 0)) { + intArray_.makeImmutable(); + result.intArray_ = intArray_; } - result.intArray_ = intArray_; - if (fooArrayBuilder_ == null) { - if (((bitField0_ & 0x00020000) == 0x00020000)) { - fooArray_ = java.util.Collections.unmodifiableList(fooArray_); - bitField0_ = (bitField0_ & ~0x00020000); - } - result.fooArray_ = fooArray_; - } else { - result.fooArray_ = fooArrayBuilder_.build(); - } - if (((bitField0_ & 0x00040000) == 0x00040000)) { - syms_ = java.util.Collections.unmodifiableList(syms_); - bitField0_ = (bitField0_ & ~0x00040000); - } - result.syms_ = syms_; - if (((from_bitField0_ & 0x00080000) == 0x00080000)) { + if (((from_bitField0_ & 0x00080000) != 0)) { + result.foo_ = fooBuilder_ == null ? foo_ : fooBuilder_.build(); to_bitField0_ |= 0x00010000; } - if (fooBuilder_ == null) { - result.foo_ = foo_; - } else { - result.foo_ = fooBuilder_.build(); - } - if (((from_bitField0_ & 0x00100000) == 0x00100000)) { + if (((from_bitField0_ & 0x00100000) != 0)) { + result.timestamp_ = timestampBuilder_ == null ? timestamp_ : timestampBuilder_.build(); to_bitField0_ |= 0x00020000; } - if (timestampBuilder_ == null) { - result.timestamp_ = timestamp_; - } else { - result.timestamp_ = timestampBuilder_.build(); - } - result.bitField0_ = to_bitField0_; - onBuilt(); - return result; - } - - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - - @java.lang.Override - public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); + result.bitField0_ |= to_bitField0_; } @java.lang.Override @@ -1934,8 +1934,8 @@ public Builder mergeFrom(org.apache.avro.protobuf.noopt.Test.Foo other) { setBool(other.getBool()); } if (other.hasString()) { - bitField0_ |= 0x00002000; string_ = other.string_; + bitField0_ |= 0x00002000; onChanged(); } if (other.hasBytes()) { @@ -1947,7 +1947,8 @@ public Builder mergeFrom(org.apache.avro.protobuf.noopt.Test.Foo other) { if (!other.intArray_.isEmpty()) { if (intArray_.isEmpty()) { intArray_ = other.intArray_; - bitField0_ = (bitField0_ & ~0x00010000); + intArray_.makeImmutable(); + bitField0_ |= 0x00010000; } else { ensureIntArrayIsMutable(); intArray_.addAll(other.intArray_); @@ -1972,8 +1973,7 @@ public Builder mergeFrom(org.apache.avro.protobuf.noopt.Test.Foo other) { fooArrayBuilder_ = null; fooArray_ = other.fooArray_; bitField0_ = (bitField0_ & ~0x00020000); - fooArrayBuilder_ = com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders - ? getFooArrayFieldBuilder() + fooArrayBuilder_ = com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ? getFooArrayFieldBuilder() : null; } else { fooArrayBuilder_.addAllMessages(other.fooArray_); @@ -1996,7 +1996,7 @@ public Builder mergeFrom(org.apache.avro.protobuf.noopt.Test.Foo other) { if (other.hasTimestamp()) { mergeTimestamp(other.getTimestamp()); } - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -2022,17 +2022,181 @@ public final boolean isInitialized() { @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.apache.avro.protobuf.noopt.Test.Foo parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int32_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + int64_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + uint32_ = input.readUInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + uint64_ = input.readUInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + sint32_ = input.readSInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + sint64_ = input.readSInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 61: { + fixed32_ = input.readFixed32(); + bitField0_ |= 0x00000040; + break; + } // case 61 + case 65: { + fixed64_ = input.readFixed64(); + bitField0_ |= 0x00000080; + break; + } // case 65 + case 77: { + sfixed32_ = input.readSFixed32(); + bitField0_ |= 0x00000100; + break; + } // case 77 + case 81: { + sfixed64_ = input.readSFixed64(); + bitField0_ |= 0x00000200; + break; + } // case 81 + case 93: { + float_ = input.readFloat(); + bitField0_ |= 0x00000400; + break; + } // case 93 + case 97: { + double_ = input.readDouble(); + bitField0_ |= 0x00000800; + break; + } // case 97 + case 104: { + bool_ = input.readBool(); + bitField0_ |= 0x00001000; + break; + } // case 104 + case 114: { + string_ = input.readBytes(); + bitField0_ |= 0x00002000; + break; + } // case 114 + case 122: { + bytes_ = input.readBytes(); + bitField0_ |= 0x00004000; + break; + } // case 122 + case 128: { + int tmpRaw = input.readEnum(); + org.apache.avro.protobuf.noopt.Test.A tmpValue = org.apache.avro.protobuf.noopt.Test.A.forNumber(tmpRaw); + if (tmpValue == null) { + mergeUnknownVarintField(16, tmpRaw); + } else { + enum_ = tmpRaw; + bitField0_ |= 0x00008000; + } + break; + } // case 128 + case 136: { + int v = input.readInt32(); + ensureIntArrayIsMutable(); + intArray_.addInt(v); + break; + } // case 136 + case 138: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureIntArrayIsMutable(); + while (input.getBytesUntilLimit() > 0) { + intArray_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 138 + case 146: { + input.readMessage(getFooFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00080000; + break; + } // case 146 + case 152: { + int tmpRaw = input.readEnum(); + org.apache.avro.protobuf.noopt.Test.A tmpValue = org.apache.avro.protobuf.noopt.Test.A.forNumber(tmpRaw); + if (tmpValue == null) { + mergeUnknownVarintField(19, tmpRaw); + } else { + ensureSymsIsMutable(); + syms_.add(tmpRaw); + } + break; + } // case 152 + case 154: { + int length = input.readRawVarint32(); + int oldLimit = input.pushLimit(length); + while (input.getBytesUntilLimit() > 0) { + int tmpRaw = input.readEnum(); + org.apache.avro.protobuf.noopt.Test.A tmpValue = org.apache.avro.protobuf.noopt.Test.A + .forNumber(tmpRaw); + if (tmpValue == null) { + mergeUnknownVarintField(19, tmpRaw); + } else { + ensureSymsIsMutable(); + syms_.add(tmpRaw); + } + } + input.popLimit(oldLimit); + break; + } // case 154 + case 162: { + org.apache.avro.protobuf.noopt.Test.Foo m = input + .readMessage(org.apache.avro.protobuf.noopt.Test.Foo.parser(), extensionRegistry); + if (fooArrayBuilder_ == null) { + ensureFooArrayIsMutable(); + fooArray_.add(m); + } else { + fooArrayBuilder_.addMessage(m); + } + break; + } // case 162 + case 170: { + input.readMessage(getTimestampFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00100000; + break; + } // case 170 + 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) { - parsedMessage = (org.apache.avro.protobuf.noopt.Test.Foo) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally return this; } @@ -2046,9 +2210,12 @@ public Builder mergeFrom(com.google.protobuf.CodedInputStream input, * * * required int32 int32 = 1; + * + * @return Whether the int32 field is set. */ + @java.lang.Override public boolean hasInt32() { - return ((bitField0_ & 0x00000001) == 0x00000001); + return ((bitField0_ & 0x00000001) != 0); } /** @@ -2057,7 +2224,10 @@ public boolean hasInt32() { * * * required int32 int32 = 1; + * + * @return The int32. */ + @java.lang.Override public int getInt32() { return int32_; } @@ -2068,10 +2238,14 @@ public int getInt32() { * * * required int32 int32 = 1; + * + * @param value The int32 to set. + * @return This builder for chaining. */ public Builder setInt32(int value) { - bitField0_ |= 0x00000001; + int32_ = value; + bitField0_ |= 0x00000001; onChanged(); return this; } @@ -2082,6 +2256,8 @@ public Builder setInt32(int value) { * * * required int32 int32 = 1; + * + * @return This builder for chaining. */ public Builder clearInt32() { bitField0_ = (bitField0_ & ~0x00000001); @@ -2094,30 +2270,42 @@ public Builder clearInt32() { /** * optional int64 int64 = 2; + * + * @return Whether the int64 field is set. */ + @java.lang.Override public boolean hasInt64() { - return ((bitField0_ & 0x00000002) == 0x00000002); + return ((bitField0_ & 0x00000002) != 0); } /** * optional int64 int64 = 2; + * + * @return The int64. */ + @java.lang.Override public long getInt64() { return int64_; } /** * optional int64 int64 = 2; + * + * @param value The int64 to set. + * @return This builder for chaining. */ public Builder setInt64(long value) { - bitField0_ |= 0x00000002; + int64_ = value; + bitField0_ |= 0x00000002; onChanged(); return this; } /** * optional int64 int64 = 2; + * + * @return This builder for chaining. */ public Builder clearInt64() { bitField0_ = (bitField0_ & ~0x00000002); @@ -2130,30 +2318,42 @@ public Builder clearInt64() { /** * optional uint32 uint32 = 3; + * + * @return Whether the uint32 field is set. */ + @java.lang.Override public boolean hasUint32() { - return ((bitField0_ & 0x00000004) == 0x00000004); + return ((bitField0_ & 0x00000004) != 0); } /** * optional uint32 uint32 = 3; + * + * @return The uint32. */ + @java.lang.Override public int getUint32() { return uint32_; } /** * optional uint32 uint32 = 3; + * + * @param value The uint32 to set. + * @return This builder for chaining. */ public Builder setUint32(int value) { - bitField0_ |= 0x00000004; + uint32_ = value; + bitField0_ |= 0x00000004; onChanged(); return this; } /** * optional uint32 uint32 = 3; + * + * @return This builder for chaining. */ public Builder clearUint32() { bitField0_ = (bitField0_ & ~0x00000004); @@ -2166,30 +2366,42 @@ public Builder clearUint32() { /** * optional uint64 uint64 = 4; + * + * @return Whether the uint64 field is set. */ + @java.lang.Override public boolean hasUint64() { - return ((bitField0_ & 0x00000008) == 0x00000008); + return ((bitField0_ & 0x00000008) != 0); } /** * optional uint64 uint64 = 4; + * + * @return The uint64. */ + @java.lang.Override public long getUint64() { return uint64_; } /** * optional uint64 uint64 = 4; + * + * @param value The uint64 to set. + * @return This builder for chaining. */ public Builder setUint64(long value) { - bitField0_ |= 0x00000008; + uint64_ = value; + bitField0_ |= 0x00000008; onChanged(); return this; } /** * optional uint64 uint64 = 4; + * + * @return This builder for chaining. */ public Builder clearUint64() { bitField0_ = (bitField0_ & ~0x00000008); @@ -2202,30 +2414,42 @@ public Builder clearUint64() { /** * optional sint32 sint32 = 5; + * + * @return Whether the sint32 field is set. */ + @java.lang.Override public boolean hasSint32() { - return ((bitField0_ & 0x00000010) == 0x00000010); + return ((bitField0_ & 0x00000010) != 0); } /** * optional sint32 sint32 = 5; + * + * @return The sint32. */ + @java.lang.Override public int getSint32() { return sint32_; } /** * optional sint32 sint32 = 5; + * + * @param value The sint32 to set. + * @return This builder for chaining. */ public Builder setSint32(int value) { - bitField0_ |= 0x00000010; + sint32_ = value; + bitField0_ |= 0x00000010; onChanged(); return this; } /** * optional sint32 sint32 = 5; + * + * @return This builder for chaining. */ public Builder clearSint32() { bitField0_ = (bitField0_ & ~0x00000010); @@ -2238,30 +2462,42 @@ public Builder clearSint32() { /** * optional sint64 sint64 = 6; + * + * @return Whether the sint64 field is set. */ + @java.lang.Override public boolean hasSint64() { - return ((bitField0_ & 0x00000020) == 0x00000020); + return ((bitField0_ & 0x00000020) != 0); } /** * optional sint64 sint64 = 6; + * + * @return The sint64. */ + @java.lang.Override public long getSint64() { return sint64_; } /** * optional sint64 sint64 = 6; + * + * @param value The sint64 to set. + * @return This builder for chaining. */ public Builder setSint64(long value) { - bitField0_ |= 0x00000020; + sint64_ = value; + bitField0_ |= 0x00000020; onChanged(); return this; } /** * optional sint64 sint64 = 6; + * + * @return This builder for chaining. */ public Builder clearSint64() { bitField0_ = (bitField0_ & ~0x00000020); @@ -2274,30 +2510,42 @@ public Builder clearSint64() { /** * optional fixed32 fixed32 = 7; + * + * @return Whether the fixed32 field is set. */ + @java.lang.Override public boolean hasFixed32() { - return ((bitField0_ & 0x00000040) == 0x00000040); + return ((bitField0_ & 0x00000040) != 0); } /** * optional fixed32 fixed32 = 7; + * + * @return The fixed32. */ + @java.lang.Override public int getFixed32() { return fixed32_; } /** * optional fixed32 fixed32 = 7; + * + * @param value The fixed32 to set. + * @return This builder for chaining. */ public Builder setFixed32(int value) { - bitField0_ |= 0x00000040; + fixed32_ = value; + bitField0_ |= 0x00000040; onChanged(); return this; } /** * optional fixed32 fixed32 = 7; + * + * @return This builder for chaining. */ public Builder clearFixed32() { bitField0_ = (bitField0_ & ~0x00000040); @@ -2310,30 +2558,42 @@ public Builder clearFixed32() { /** * optional fixed64 fixed64 = 8; + * + * @return Whether the fixed64 field is set. */ + @java.lang.Override public boolean hasFixed64() { - return ((bitField0_ & 0x00000080) == 0x00000080); + return ((bitField0_ & 0x00000080) != 0); } /** * optional fixed64 fixed64 = 8; + * + * @return The fixed64. */ + @java.lang.Override public long getFixed64() { return fixed64_; } /** * optional fixed64 fixed64 = 8; + * + * @param value The fixed64 to set. + * @return This builder for chaining. */ public Builder setFixed64(long value) { - bitField0_ |= 0x00000080; + fixed64_ = value; + bitField0_ |= 0x00000080; onChanged(); return this; } /** * optional fixed64 fixed64 = 8; + * + * @return This builder for chaining. */ public Builder clearFixed64() { bitField0_ = (bitField0_ & ~0x00000080); @@ -2346,30 +2606,42 @@ public Builder clearFixed64() { /** * optional sfixed32 sfixed32 = 9; + * + * @return Whether the sfixed32 field is set. */ + @java.lang.Override public boolean hasSfixed32() { - return ((bitField0_ & 0x00000100) == 0x00000100); + return ((bitField0_ & 0x00000100) != 0); } /** * optional sfixed32 sfixed32 = 9; + * + * @return The sfixed32. */ + @java.lang.Override public int getSfixed32() { return sfixed32_; } /** * optional sfixed32 sfixed32 = 9; + * + * @param value The sfixed32 to set. + * @return This builder for chaining. */ public Builder setSfixed32(int value) { - bitField0_ |= 0x00000100; + sfixed32_ = value; + bitField0_ |= 0x00000100; onChanged(); return this; } /** * optional sfixed32 sfixed32 = 9; + * + * @return This builder for chaining. */ public Builder clearSfixed32() { bitField0_ = (bitField0_ & ~0x00000100); @@ -2382,30 +2654,42 @@ public Builder clearSfixed32() { /** * optional sfixed64 sfixed64 = 10; + * + * @return Whether the sfixed64 field is set. */ + @java.lang.Override public boolean hasSfixed64() { - return ((bitField0_ & 0x00000200) == 0x00000200); + return ((bitField0_ & 0x00000200) != 0); } /** * optional sfixed64 sfixed64 = 10; + * + * @return The sfixed64. */ + @java.lang.Override public long getSfixed64() { return sfixed64_; } /** * optional sfixed64 sfixed64 = 10; + * + * @param value The sfixed64 to set. + * @return This builder for chaining. */ public Builder setSfixed64(long value) { - bitField0_ |= 0x00000200; + sfixed64_ = value; + bitField0_ |= 0x00000200; onChanged(); return this; } /** * optional sfixed64 sfixed64 = 10; + * + * @return This builder for chaining. */ public Builder clearSfixed64() { bitField0_ = (bitField0_ & ~0x00000200); @@ -2418,30 +2702,42 @@ public Builder clearSfixed64() { /** * optional float float = 11; + * + * @return Whether the float field is set. */ + @java.lang.Override public boolean hasFloat() { - return ((bitField0_ & 0x00000400) == 0x00000400); + return ((bitField0_ & 0x00000400) != 0); } /** * optional float float = 11; + * + * @return The float. */ + @java.lang.Override public float getFloat() { return float_; } /** * optional float float = 11; + * + * @param value The float to set. + * @return This builder for chaining. */ public Builder setFloat(float value) { - bitField0_ |= 0x00000400; + float_ = value; + bitField0_ |= 0x00000400; onChanged(); return this; } /** * optional float float = 11; + * + * @return This builder for chaining. */ public Builder clearFloat() { bitField0_ = (bitField0_ & ~0x00000400); @@ -2454,30 +2750,42 @@ public Builder clearFloat() { /** * optional double double = 12; + * + * @return Whether the double field is set. */ + @java.lang.Override public boolean hasDouble() { - return ((bitField0_ & 0x00000800) == 0x00000800); + return ((bitField0_ & 0x00000800) != 0); } /** * optional double double = 12; + * + * @return The double. */ + @java.lang.Override public double getDouble() { return double_; } /** * optional double double = 12; + * + * @param value The double to set. + * @return This builder for chaining. */ public Builder setDouble(double value) { - bitField0_ |= 0x00000800; + double_ = value; + bitField0_ |= 0x00000800; onChanged(); return this; } /** * optional double double = 12; + * + * @return This builder for chaining. */ public Builder clearDouble() { bitField0_ = (bitField0_ & ~0x00000800); @@ -2490,30 +2798,42 @@ public Builder clearDouble() { /** * optional bool bool = 13; + * + * @return Whether the bool field is set. */ + @java.lang.Override public boolean hasBool() { - return ((bitField0_ & 0x00001000) == 0x00001000); + return ((bitField0_ & 0x00001000) != 0); } /** * optional bool bool = 13; + * + * @return The bool. */ + @java.lang.Override public boolean getBool() { return bool_; } /** * optional bool bool = 13; + * + * @param value The bool to set. + * @return This builder for chaining. */ public Builder setBool(boolean value) { - bitField0_ |= 0x00001000; + bool_ = value; + bitField0_ |= 0x00001000; onChanged(); return this; } /** * optional bool bool = 13; + * + * @return This builder for chaining. */ public Builder clearBool() { bitField0_ = (bitField0_ & ~0x00001000); @@ -2526,13 +2846,17 @@ public Builder clearBool() { /** * optional string string = 14; + * + * @return Whether the string field is set. */ public boolean hasString() { - return ((bitField0_ & 0x00002000) == 0x00002000); + return ((bitField0_ & 0x00002000) != 0); } /** * optional string string = 14; + * + * @return The string. */ public java.lang.String getString() { java.lang.Object ref = string_; @@ -2550,6 +2874,8 @@ public java.lang.String getString() { /** * optional string string = 14; + * + * @return The bytes for string. */ public com.google.protobuf.ByteString getStringBytes() { java.lang.Object ref = string_; @@ -2564,36 +2890,44 @@ public com.google.protobuf.ByteString getStringBytes() { /** * optional string string = 14; + * + * @param value The string to set. + * @return This builder for chaining. */ public Builder setString(java.lang.String value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00002000; string_ = value; + bitField0_ |= 0x00002000; onChanged(); return this; } /** * optional string string = 14; + * + * @return This builder for chaining. */ public Builder clearString() { - bitField0_ = (bitField0_ & ~0x00002000); string_ = getDefaultInstance().getString(); + bitField0_ = (bitField0_ & ~0x00002000); onChanged(); return this; } /** * optional string string = 14; + * + * @param value The bytes for string to set. + * @return This builder for chaining. */ public Builder setStringBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00002000; string_ = value; + bitField0_ |= 0x00002000; onChanged(); return this; } @@ -2602,33 +2936,44 @@ public Builder setStringBytes(com.google.protobuf.ByteString value) { /** * optional bytes bytes = 15; + * + * @return Whether the bytes field is set. */ + @java.lang.Override public boolean hasBytes() { - return ((bitField0_ & 0x00004000) == 0x00004000); + return ((bitField0_ & 0x00004000) != 0); } /** * optional bytes bytes = 15; + * + * @return The bytes. */ + @java.lang.Override public com.google.protobuf.ByteString getBytes() { return bytes_; } /** * optional bytes bytes = 15; + * + * @param value The bytes to set. + * @return This builder for chaining. */ public Builder setBytes(com.google.protobuf.ByteString value) { if (value == null) { throw new NullPointerException(); } - bitField0_ |= 0x00004000; bytes_ = value; + bitField0_ |= 0x00004000; onChanged(); return this; } /** * optional bytes bytes = 15; + * + * @return This builder for chaining. */ public Builder clearBytes() { bitField0_ = (bitField0_ & ~0x00004000); @@ -2641,22 +2986,30 @@ public Builder clearBytes() { /** * optional .org.apache.avro.protobuf.noopt.A enum = 16 [default = Z]; + * + * @return Whether the enum field is set. */ + @java.lang.Override public boolean hasEnum() { - return ((bitField0_ & 0x00008000) == 0x00008000); + return ((bitField0_ & 0x00008000) != 0); } /** * optional .org.apache.avro.protobuf.noopt.A enum = 16 [default = Z]; + * + * @return The enum. */ + @java.lang.Override public org.apache.avro.protobuf.noopt.Test.A getEnum() { - @SuppressWarnings("deprecation") - org.apache.avro.protobuf.noopt.Test.A result = org.apache.avro.protobuf.noopt.Test.A.valueOf(enum_); + org.apache.avro.protobuf.noopt.Test.A result = org.apache.avro.protobuf.noopt.Test.A.forNumber(enum_); return result == null ? org.apache.avro.protobuf.noopt.Test.A.Z : result; } /** * optional .org.apache.avro.protobuf.noopt.A enum = 16 [default = Z]; + * + * @param value The enum to set. + * @return This builder for chaining. */ public Builder setEnum(org.apache.avro.protobuf.noopt.Test.A value) { if (value == null) { @@ -2670,6 +3023,8 @@ public Builder setEnum(org.apache.avro.protobuf.noopt.Test.A value) { /** * optional .org.apache.avro.protobuf.noopt.A enum = 16 [default = Z]; + * + * @return This builder for chaining. */ public Builder clearEnum() { bitField0_ = (bitField0_ & ~0x00008000); @@ -2678,13 +3033,13 @@ public Builder clearEnum() { return this; } - private java.util.List intArray_ = java.util.Collections.emptyList(); + private com.google.protobuf.Internal.IntList intArray_ = emptyIntList(); private void ensureIntArrayIsMutable() { - if (!((bitField0_ & 0x00010000) == 0x00010000)) { - intArray_ = new java.util.ArrayList(intArray_); - bitField0_ |= 0x00010000; + if (!intArray_.isModifiable()) { + intArray_ = makeMutableCopy(intArray_); } + bitField0_ |= 0x00010000; } /** @@ -2693,9 +3048,12 @@ private void ensureIntArrayIsMutable() { * * * repeated int32 intArray = 17; + * + * @return A list containing the intArray. */ public java.util.List getIntArrayList() { - return java.util.Collections.unmodifiableList(intArray_); + intArray_.makeImmutable(); + return intArray_; } /** @@ -2704,6 +3062,8 @@ public java.util.List getIntArrayList() { * * * repeated int32 intArray = 17; + * + * @return The count of intArray. */ public int getIntArrayCount() { return intArray_.size(); @@ -2715,9 +3075,12 @@ public int getIntArrayCount() { * * * repeated int32 intArray = 17; + * + * @param index The index of the element to return. + * @return The intArray at the given index. */ public int getIntArray(int index) { - return intArray_.get(index); + return intArray_.getInt(index); } /** @@ -2726,10 +3089,16 @@ public int getIntArray(int index) { * * * repeated int32 intArray = 17; + * + * @param index The index to set the value at. + * @param value The intArray to set. + * @return This builder for chaining. */ public Builder setIntArray(int index, int value) { + ensureIntArrayIsMutable(); - intArray_.set(index, value); + intArray_.setInt(index, value); + bitField0_ |= 0x00010000; onChanged(); return this; } @@ -2740,10 +3109,15 @@ public Builder setIntArray(int index, int value) { * * * repeated int32 intArray = 17; + * + * @param value The intArray to add. + * @return This builder for chaining. */ public Builder addIntArray(int value) { + ensureIntArrayIsMutable(); - intArray_.add(value); + intArray_.addInt(value); + bitField0_ |= 0x00010000; onChanged(); return this; } @@ -2754,10 +3128,14 @@ public Builder addIntArray(int value) { * * * repeated int32 intArray = 17; + * + * @param values The intArray to add. + * @return This builder for chaining. */ public Builder addAllIntArray(java.lang.Iterable values) { ensureIntArrayIsMutable(); com.google.protobuf.AbstractMessageLite.Builder.addAll(values, intArray_); + bitField0_ |= 0x00010000; onChanged(); return this; } @@ -2768,9 +3146,11 @@ public Builder addAllIntArray(java.lang.Iterable va * * * repeated int32 intArray = 17; + * + * @return This builder for chaining. */ public Builder clearIntArray() { - intArray_ = java.util.Collections.emptyList(); + intArray_ = emptyIntList(); bitField0_ = (bitField0_ & ~0x00010000); onChanged(); return this; @@ -2779,13 +3159,13 @@ public Builder clearIntArray() { private java.util.List fooArray_ = java.util.Collections.emptyList(); private void ensureFooArrayIsMutable() { - if (!((bitField0_ & 0x00020000) == 0x00020000)) { + if (!((bitField0_ & 0x00020000) != 0)) { fooArray_ = new java.util.ArrayList(fooArray_); bitField0_ |= 0x00020000; } } - private com.google.protobuf.RepeatedFieldBuilderV3 fooArrayBuilder_; + private com.google.protobuf.RepeatedFieldBuilder fooArrayBuilder_; /** * repeated .org.apache.avro.protobuf.noopt.Foo fooArray = 20; @@ -3006,10 +3386,10 @@ public java.util.List getFooArr return getFooArrayFieldBuilder().getBuilderList(); } - private com.google.protobuf.RepeatedFieldBuilderV3 getFooArrayFieldBuilder() { + private com.google.protobuf.RepeatedFieldBuilder getFooArrayFieldBuilder() { if (fooArrayBuilder_ == null) { - fooArrayBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3( - fooArray_, ((bitField0_ & 0x00020000) == 0x00020000), getParentForChildren(), isClean()); + fooArrayBuilder_ = new com.google.protobuf.RepeatedFieldBuilder( + fooArray_, ((bitField0_ & 0x00020000) != 0), getParentForChildren(), isClean()); fooArray_ = null; } return fooArrayBuilder_; @@ -3018,7 +3398,7 @@ private com.google.protobuf.RepeatedFieldBuilderV3 syms_ = java.util.Collections.emptyList(); private void ensureSymsIsMutable() { - if (!((bitField0_ & 0x00040000) == 0x00040000)) { + if (!((bitField0_ & 0x00040000) != 0)) { syms_ = new java.util.ArrayList(syms_); bitField0_ |= 0x00040000; } @@ -3026,6 +3406,8 @@ private void ensureSymsIsMutable() { /** * repeated .org.apache.avro.protobuf.noopt.A syms = 19; + * + * @return A list containing the syms. */ public java.util.List getSymsList() { return new com.google.protobuf.Internal.ListAdapter( @@ -3034,6 +3416,8 @@ public java.util.List getSymsList() { /** * repeated .org.apache.avro.protobuf.noopt.A syms = 19; + * + * @return The count of syms. */ public int getSymsCount() { return syms_.size(); @@ -3041,6 +3425,9 @@ public int getSymsCount() { /** * repeated .org.apache.avro.protobuf.noopt.A syms = 19; + * + * @param index The index of the element to return. + * @return The syms at the given index. */ public org.apache.avro.protobuf.noopt.Test.A getSyms(int index) { return syms_converter_.convert(syms_.get(index)); @@ -3048,6 +3435,10 @@ public org.apache.avro.protobuf.noopt.Test.A getSyms(int index) { /** * repeated .org.apache.avro.protobuf.noopt.A syms = 19; + * + * @param index The index to set the value at. + * @param value The syms to set. + * @return This builder for chaining. */ public Builder setSyms(int index, org.apache.avro.protobuf.noopt.Test.A value) { if (value == null) { @@ -3061,6 +3452,9 @@ public Builder setSyms(int index, org.apache.avro.protobuf.noopt.Test.A value) { /** * repeated .org.apache.avro.protobuf.noopt.A syms = 19; + * + * @param value The syms to add. + * @return This builder for chaining. */ public Builder addSyms(org.apache.avro.protobuf.noopt.Test.A value) { if (value == null) { @@ -3074,6 +3468,9 @@ public Builder addSyms(org.apache.avro.protobuf.noopt.Test.A value) { /** * repeated .org.apache.avro.protobuf.noopt.A syms = 19; + * + * @param values The syms to add. + * @return This builder for chaining. */ public Builder addAllSyms(java.lang.Iterable values) { ensureSymsIsMutable(); @@ -3086,6 +3483,8 @@ public Builder addAllSyms(java.lang.Iterablerepeated .org.apache.avro.protobuf.noopt.A syms = 19; + * + * @return This builder for chaining. */ public Builder clearSyms() { syms_ = java.util.Collections.emptyList(); @@ -3094,8 +3493,8 @@ public Builder clearSyms() { return this; } - private org.apache.avro.protobuf.noopt.Test.Foo foo_ = null; - private com.google.protobuf.SingleFieldBuilderV3 fooBuilder_; + private org.apache.avro.protobuf.noopt.Test.Foo foo_; + private com.google.protobuf.SingleFieldBuilder fooBuilder_; /** *
@@ -3103,9 +3502,11 @@ public Builder clearSyms() {
        * 
* * optional .org.apache.avro.protobuf.noopt.Foo foo = 18; + * + * @return Whether the foo field is set. */ public boolean hasFoo() { - return ((bitField0_ & 0x00080000) == 0x00080000); + return ((bitField0_ & 0x00080000) != 0); } /** @@ -3114,6 +3515,8 @@ public boolean hasFoo() { * * * optional .org.apache.avro.protobuf.noopt.Foo foo = 18; + * + * @return The foo. */ public org.apache.avro.protobuf.noopt.Test.Foo getFoo() { if (fooBuilder_ == null) { @@ -3136,11 +3539,11 @@ public Builder setFoo(org.apache.avro.protobuf.noopt.Test.Foo value) { throw new NullPointerException(); } foo_ = value; - onChanged(); } else { fooBuilder_.setMessage(value); } bitField0_ |= 0x00080000; + onChanged(); return this; } @@ -3154,11 +3557,11 @@ public Builder setFoo(org.apache.avro.protobuf.noopt.Test.Foo value) { public Builder setFoo(org.apache.avro.protobuf.noopt.Test.Foo.Builder builderForValue) { if (fooBuilder_ == null) { foo_ = builderForValue.build(); - onChanged(); } else { fooBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00080000; + onChanged(); return this; } @@ -3171,17 +3574,19 @@ public Builder setFoo(org.apache.avro.protobuf.noopt.Test.Foo.Builder builderFor */ public Builder mergeFoo(org.apache.avro.protobuf.noopt.Test.Foo value) { if (fooBuilder_ == null) { - if (((bitField0_ & 0x00080000) == 0x00080000) && foo_ != null + if (((bitField0_ & 0x00080000) != 0) && foo_ != null && foo_ != org.apache.avro.protobuf.noopt.Test.Foo.getDefaultInstance()) { - foo_ = org.apache.avro.protobuf.noopt.Test.Foo.newBuilder(foo_).mergeFrom(value).buildPartial(); + getFooBuilder().mergeFrom(value); } else { foo_ = value; } - onChanged(); } else { fooBuilder_.mergeFrom(value); } - bitField0_ |= 0x00080000; + if (foo_ != null) { + bitField0_ |= 0x00080000; + onChanged(); + } return this; } @@ -3193,13 +3598,13 @@ public Builder mergeFoo(org.apache.avro.protobuf.noopt.Test.Foo value) { * optional .org.apache.avro.protobuf.noopt.Foo foo = 18; */ public Builder clearFoo() { - if (fooBuilder_ == null) { - foo_ = null; - onChanged(); - } else { - fooBuilder_.clear(); - } bitField0_ = (bitField0_ & ~0x00080000); + foo_ = null; + if (fooBuilder_ != null) { + fooBuilder_.dispose(); + fooBuilder_ = null; + } + onChanged(); return this; } @@ -3238,17 +3643,17 @@ public org.apache.avro.protobuf.noopt.Test.FooOrBuilder getFooOrBuilder() { * * optional .org.apache.avro.protobuf.noopt.Foo foo = 18; */ - private com.google.protobuf.SingleFieldBuilderV3 getFooFieldBuilder() { + private com.google.protobuf.SingleFieldBuilder getFooFieldBuilder() { if (fooBuilder_ == null) { - fooBuilder_ = new com.google.protobuf.SingleFieldBuilderV3( + fooBuilder_ = new com.google.protobuf.SingleFieldBuilder( getFoo(), getParentForChildren(), isClean()); foo_ = null; } return fooBuilder_; } - private com.google.protobuf.Timestamp timestamp_ = null; - private com.google.protobuf.SingleFieldBuilderV3 timestampBuilder_; + private com.google.protobuf.Timestamp timestamp_; + private com.google.protobuf.SingleFieldBuilder timestampBuilder_; /** *
@@ -3256,9 +3661,11 @@ private com.google.protobuf.SingleFieldBuilderV3
        *
        * optional .google.protobuf.Timestamp timestamp = 21;
+       * 
+       * @return Whether the timestamp field is set.
        */
       public boolean hasTimestamp() {
-        return ((bitField0_ & 0x00100000) == 0x00100000);
+        return ((bitField0_ & 0x00100000) != 0);
       }
 
       /**
@@ -3267,6 +3674,8 @@ public boolean hasTimestamp() {
        * 
* * optional .google.protobuf.Timestamp timestamp = 21; + * + * @return The timestamp. */ public com.google.protobuf.Timestamp getTimestamp() { if (timestampBuilder_ == null) { @@ -3289,11 +3698,11 @@ public Builder setTimestamp(com.google.protobuf.Timestamp value) { throw new NullPointerException(); } timestamp_ = value; - onChanged(); } else { timestampBuilder_.setMessage(value); } bitField0_ |= 0x00100000; + onChanged(); return this; } @@ -3307,11 +3716,11 @@ public Builder setTimestamp(com.google.protobuf.Timestamp value) { public Builder setTimestamp(com.google.protobuf.Timestamp.Builder builderForValue) { if (timestampBuilder_ == null) { timestamp_ = builderForValue.build(); - onChanged(); } else { timestampBuilder_.setMessage(builderForValue.build()); } bitField0_ |= 0x00100000; + onChanged(); return this; } @@ -3324,17 +3733,19 @@ public Builder setTimestamp(com.google.protobuf.Timestamp.Builder builderForValu */ public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { if (timestampBuilder_ == null) { - if (((bitField0_ & 0x00100000) == 0x00100000) && timestamp_ != null + if (((bitField0_ & 0x00100000) != 0) && timestamp_ != null && timestamp_ != com.google.protobuf.Timestamp.getDefaultInstance()) { - timestamp_ = com.google.protobuf.Timestamp.newBuilder(timestamp_).mergeFrom(value).buildPartial(); + getTimestampBuilder().mergeFrom(value); } else { timestamp_ = value; } - onChanged(); } else { timestampBuilder_.mergeFrom(value); } - bitField0_ |= 0x00100000; + if (timestamp_ != null) { + bitField0_ |= 0x00100000; + onChanged(); + } return this; } @@ -3346,13 +3757,13 @@ public Builder mergeTimestamp(com.google.protobuf.Timestamp value) { * optional .google.protobuf.Timestamp timestamp = 21; */ public Builder clearTimestamp() { - if (timestampBuilder_ == null) { - timestamp_ = null; - onChanged(); - } else { - timestampBuilder_.clear(); - } bitField0_ = (bitField0_ & ~0x00100000); + timestamp_ = null; + if (timestampBuilder_ != null) { + timestampBuilder_.dispose(); + timestampBuilder_ = null; + } + onChanged(); return this; } @@ -3391,25 +3802,15 @@ public com.google.protobuf.TimestampOrBuilder getTimestampOrBuilder() { * * optional .google.protobuf.Timestamp timestamp = 21; */ - private com.google.protobuf.SingleFieldBuilderV3 getTimestampFieldBuilder() { + private com.google.protobuf.SingleFieldBuilder getTimestampFieldBuilder() { if (timestampBuilder_ == null) { - timestampBuilder_ = new com.google.protobuf.SingleFieldBuilderV3( + timestampBuilder_ = new com.google.protobuf.SingleFieldBuilder( getTimestamp(), getParentForChildren(), isClean()); timestamp_ = null; } return timestampBuilder_; } - @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.avro.protobuf.noopt.Foo) } @@ -3423,13 +3824,22 @@ public static org.apache.avro.protobuf.noopt.Test.Foo getDefaultInstance() { return DEFAULT_INSTANCE; } - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public Foo parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new Foo(input, extensionRegistry); + 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(); } }; @@ -3461,63 +3871,30 @@ public interface MOrBuilder extends * * Protobuf type {@code org.apache.avro.protobuf.noopt.M} */ - public static final class M extends com.google.protobuf.GeneratedMessageV3 implements + public static final class M extends com.google.protobuf.GeneratedMessage implements // @@protoc_insertion_point(message_implements:org.apache.avro.protobuf.noopt.M) MOrBuilder { private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */ 4, /* minor= */ 26, /* patch= */ 1, + /* suffix= */ "", M.class.getName()); + } // Use M.newBuilder() to construct. - private M(com.google.protobuf.GeneratedMessageV3.Builder builder) { + private M(com.google.protobuf.GeneratedMessage.Builder builder) { super(builder); } private M() { } - @java.lang.Override - public final com.google.protobuf.UnknownFieldSet getUnknownFields() { - return this.unknownFields; - } - - private M(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; - 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.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_M_descriptor; } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_M_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.Test.M.class, org.apache.avro.protobuf.noopt.Test.M.Builder.class); @@ -3532,6 +3909,11 @@ public enum N implements com.google.protobuf.ProtocolMessageEnum { */ A(1),; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, /* major= */ 4, /* minor= */ 26, /* patch= */ 1, + /* suffix= */ "", N.class.getName()); + } /** * A = 1; */ @@ -3542,6 +3924,8 @@ public final int getNumber() { } /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated @@ -3549,6 +3933,10 @@ public static N valueOf(int value) { return forNumber(value); } + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ public static N forNumber(int value) { switch (value) { case 1: @@ -3614,7 +4002,7 @@ public final boolean isInitialized() { @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { - unknownFields.writeTo(output); + getUnknownFields().writeTo(output); } @java.lang.Override @@ -3624,7 +4012,7 @@ public int getSerializedSize() { return size; size = 0; - size += unknownFields.getSerializedSize(); + size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; } @@ -3639,9 +4027,9 @@ public boolean equals(final java.lang.Object obj) { } org.apache.avro.protobuf.noopt.Test.M other = (org.apache.avro.protobuf.noopt.Test.M) obj; - boolean result = true; - result = result && unknownFields.equals(other.unknownFields); - return result; + if (!getUnknownFields().equals(other.getUnknownFields())) + return false; + return true; } @java.lang.Override @@ -3651,7 +4039,7 @@ public int hashCode() { } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); - hash = (29 * hash) + unknownFields.hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; } @@ -3691,32 +4079,32 @@ public static org.apache.avro.protobuf.noopt.Test.M parseFrom(byte[] data, public static org.apache.avro.protobuf.noopt.Test.M parseFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static org.apache.avro.protobuf.noopt.Test.M parseFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); } public static org.apache.avro.protobuf.noopt.Test.M parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input); } public static org.apache.avro.protobuf.noopt.Test.M parseDelimitedFrom(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input, extensionRegistry); + return com.google.protobuf.GeneratedMessage.parseDelimitedWithIOException(PARSER, input, extensionRegistry); } public static org.apache.avro.protobuf.noopt.Test.M parseFrom(com.google.protobuf.CodedInputStream input) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input); } public static org.apache.avro.protobuf.noopt.Test.M parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input, extensionRegistry); + return com.google.protobuf.GeneratedMessage.parseWithIOException(PARSER, input, extensionRegistry); } @java.lang.Override @@ -3738,7 +4126,7 @@ public Builder toBuilder() { } @java.lang.Override - protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + protected Builder newBuilderForType(com.google.protobuf.GeneratedMessage.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } @@ -3750,7 +4138,7 @@ protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.Build * * Protobuf type {@code org.apache.avro.protobuf.noopt.M} */ - public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder implements + public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder implements // @@protoc_insertion_point(builder_implements:org.apache.avro.protobuf.noopt.M) org.apache.avro.protobuf.noopt.Test.MOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { @@ -3758,7 +4146,7 @@ public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { } @java.lang.Override - protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable internalGetFieldAccessorTable() { return org.apache.avro.protobuf.noopt.Test.internal_static_org_apache_avro_protobuf_noopt_M_fieldAccessorTable .ensureFieldAccessorsInitialized(org.apache.avro.protobuf.noopt.Test.M.class, org.apache.avro.protobuf.noopt.Test.M.Builder.class); @@ -3766,17 +4154,12 @@ protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetF // Construct using org.apache.avro.protobuf.noopt.Test.M.newBuilder() private Builder() { - maybeForceBuilderInitialization(); + } - private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) { super(parent); - maybeForceBuilderInitialization(); - } - private void maybeForceBuilderInitialization() { - if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) { - } } @java.lang.Override @@ -3811,37 +4194,6 @@ public org.apache.avro.protobuf.noopt.Test.M buildPartial() { return result; } - @java.lang.Override - public Builder clone() { - return (Builder) super.clone(); - } - - @java.lang.Override - public Builder setField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.setField(field, value); - } - - @java.lang.Override - public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { - return (Builder) super.clearField(field); - } - - @java.lang.Override - public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { - return (Builder) super.clearOneof(oneof); - } - - @java.lang.Override - public Builder setRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, int index, - java.lang.Object value) { - return (Builder) super.setRepeatedField(field, index, value); - } - - @java.lang.Override - public Builder addRepeatedField(com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { - return (Builder) super.addRepeatedField(field, value); - } - @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof org.apache.avro.protobuf.noopt.Test.M) { @@ -3855,7 +4207,7 @@ public Builder mergeFrom(com.google.protobuf.Message other) { public Builder mergeFrom(org.apache.avro.protobuf.noopt.Test.M other) { if (other == org.apache.avro.protobuf.noopt.Test.M.getDefaultInstance()) return this; - this.mergeUnknownFields(other.unknownFields); + this.mergeUnknownFields(other.getUnknownFields()); onChanged(); return this; } @@ -3868,30 +4220,33 @@ public final boolean isInitialized() { @java.lang.Override public Builder mergeFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { - org.apache.avro.protobuf.noopt.Test.M parsedMessage = null; + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } try { - parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + 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) { - parsedMessage = (org.apache.avro.protobuf.noopt.Test.M) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { - if (parsedMessage != null) { - mergeFrom(parsedMessage); - } - } + onChanged(); + } // finally 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.avro.protobuf.noopt.M) } @@ -3905,13 +4260,22 @@ public static org.apache.avro.protobuf.noopt.Test.M getDefaultInstance() { return DEFAULT_INSTANCE; } - @java.lang.Deprecated - public static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + private static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { @java.lang.Override public M parsePartialFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new M(input, extensionRegistry); + 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(); } }; @@ -3932,9 +4296,9 @@ public org.apache.avro.protobuf.noopt.Test.M getDefaultInstanceForType() { } private static final com.google.protobuf.Descriptors.Descriptor internal_static_org_apache_avro_protobuf_noopt_Foo_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_org_apache_avro_protobuf_noopt_Foo_fieldAccessorTable; + private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_org_apache_avro_protobuf_noopt_Foo_fieldAccessorTable; private static final com.google.protobuf.Descriptors.Descriptor internal_static_org_apache_avro_protobuf_noopt_M_descriptor; - private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_org_apache_avro_protobuf_noopt_M_fieldAccessorTable; + private static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_org_apache_avro_protobuf_noopt_M_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { return descriptor; @@ -3958,25 +4322,18 @@ public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { + "opt.Foo\022-\n\ttimestamp\030\025 \001(\0132\032.google.prot" + "obuf.Timestamp\"\017\n\001M\"\n\n\001N\022\005\n\001A\020\001*\030\n\001A\022\005\n\001" + "X\020\001\022\005\n\001Y\020\002\022\005\n\001Z\020\003" }; - com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = new com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner() { - public com.google.protobuf.ExtensionRegistry assignDescriptors( - com.google.protobuf.Descriptors.FileDescriptor root) { - descriptor = root; - return null; - } - }; - com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, - new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.TimestampProto.getDescriptor(), }, - assigner); + descriptor = com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { com.google.protobuf.TimestampProto.getDescriptor(), }); internal_static_org_apache_avro_protobuf_noopt_Foo_descriptor = getDescriptor().getMessageTypes().get(0); - internal_static_org_apache_avro_protobuf_noopt_Foo_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_apache_avro_protobuf_noopt_Foo_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_apache_avro_protobuf_noopt_Foo_descriptor, new java.lang.String[] { "Int32", "Int64", "Uint32", "Uint64", "Sint32", "Sint64", "Fixed32", "Fixed64", "Sfixed32", "Sfixed64", "Float", "Double", "Bool", "String", "Bytes", "Enum", "IntArray", "FooArray", "Syms", "Foo", "Timestamp", }); internal_static_org_apache_avro_protobuf_noopt_M_descriptor = getDescriptor().getMessageTypes().get(1); - internal_static_org_apache_avro_protobuf_noopt_M_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_apache_avro_protobuf_noopt_M_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_org_apache_avro_protobuf_noopt_M_descriptor, new java.lang.String[] {}); + descriptor.resolveAllFeaturesImmutable(); com.google.protobuf.TimestampProto.getDescriptor(); }