diff --git a/redisson/pom.xml b/redisson/pom.xml index 9bc1dbf83..575028af4 100644 --- a/redisson/pom.xml +++ b/redisson/pom.xml @@ -397,6 +397,33 @@ 3.5.3 test + + + io.protostuff + protostuff-core + 1.8.0 + true + + + io.protostuff + protostuff-runtime + 1.8.0 + true + + + com.google.protobuf + protobuf-java + 3.16.3 + provided + true + + + com.google.protobuf + protobuf-java-util + 3.16.3 + provided + true + diff --git a/redisson/src/main/java/org/redisson/codec/ProtobufCodec.java b/redisson/src/main/java/org/redisson/codec/ProtobufCodec.java new file mode 100644 index 000000000..e2e583949 --- /dev/null +++ b/redisson/src/main/java/org/redisson/codec/ProtobufCodec.java @@ -0,0 +1,223 @@ +/** + * Copyright (c) 2013-2022 Nikita Koksharov + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.redisson.codec; + +import com.fasterxml.jackson.databind.cfg.SerializerFactoryConfig; +import com.fasterxml.jackson.databind.ser.BasicSerializerFactory; +import com.google.protobuf.MessageLite; +import io.netty.buffer.ByteBuf; +import io.netty.buffer.ByteBufAllocator; +import io.protostuff.LinkedBuffer; +import io.protostuff.ProtostuffIOUtil; +import io.protostuff.Schema; +import io.protostuff.runtime.RuntimeSchema; +import org.redisson.client.codec.BaseCodec; +import org.redisson.client.codec.Codec; +import org.redisson.client.handler.State; +import org.redisson.client.protocol.Decoder; +import org.redisson.client.protocol.Encoder; + +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; + +public class ProtobufCodec extends BaseCodec { + private final Class mapKeyClass; + private final Class mapValueClass; + private final Class valueClass; + + //classes in blacklist will not be serialized using protobuf ,but instead will use blacklistCodec + private final Set protobufBlacklist; + //default value is JsonJacksonCodec + private final Codec blacklistCodec; + + public ProtobufCodec(Class mapKeyClass, Class mapValueClass) { + this(mapKeyClass, mapValueClass, null, null); + } + + /** + * @param blacklistCodec classes in protobufBlacklist will use this codec + */ + public ProtobufCodec(Class mapKeyClass, Class mapValueClass, Codec blacklistCodec) { + this(mapKeyClass, mapValueClass, null, blacklistCodec); + } + + public ProtobufCodec(Class valueClass) { + this(null, null, valueClass, null); + } + + /** + * @param blacklistCodec classes in protobufBlacklist will use this codec + */ + public ProtobufCodec(Class valueClass, Codec blacklistCodec) { + this(null, null, valueClass, blacklistCodec); + } + + private ProtobufCodec(Class mapKeyClass, Class mapValueClass, Class valueClass, Codec blacklistCodec) { + this.mapKeyClass = mapKeyClass; + this.mapValueClass = mapValueClass; + this.valueClass = valueClass; + if (blacklistCodec == null) { + this.blacklistCodec = new JsonJacksonCodec(); + } else { + if (blacklistCodec instanceof ProtobufCodec) { + //will loop infinitely when encode or decode + throw new IllegalArgumentException("BlacklistCodec can not be ProtobufCodec"); + } + this.blacklistCodec = blacklistCodec; + } + + protobufBlacklist = new HashSet<>(); + protobufBlacklist.addAll(BasicSerializerFactoryConcreteGetter.getConcreteKeySet()); + protobufBlacklist.add(ArrayList.class.getName()); + protobufBlacklist.add(HashSet.class.getName()); + protobufBlacklist.add(HashMap.class.getName()); + } + + public void addBlacklist(Class clazz) { + protobufBlacklist.add(clazz.getName()); + } + + public void removeBlacklist(Class clazz) { + protobufBlacklist.remove(clazz.getName()); + } + + @Override + public Decoder getValueDecoder() { + return createDecoder(valueClass, blacklistCodec.getValueDecoder()); + } + + @Override + public Encoder getValueEncoder() { + return createEncoder(valueClass, blacklistCodec.getValueEncoder()); + } + + @Override + public Decoder getMapValueDecoder() { + return createDecoder(mapValueClass, blacklistCodec.getMapValueDecoder()); + } + + @Override + public Encoder getMapValueEncoder() { + return createEncoder(mapValueClass, blacklistCodec.getMapValueEncoder()); + } + + @Override + public Decoder getMapKeyDecoder() { + return createDecoder(mapKeyClass, blacklistCodec.getMapKeyDecoder()); + } + + @Override + public Encoder getMapKeyEncoder() { + return createEncoder(mapKeyClass, blacklistCodec.getMapKeyEncoder()); + } + + private Decoder createDecoder(Class clazz, Decoder blacklistDecoder) { + if (clazz == null) { + throw new IllegalArgumentException("class to create protobuf decoder can not be null"); + } + + return new Decoder() { + @Override + public Object decode(ByteBuf buf, State state) throws IOException { + //use blacklistDecoder + if (protobufBlacklist.contains(clazz.getName())) { + return blacklistDecoder.decode(buf, state); + } + + byte[] bytes = new byte[buf.readableBytes()]; + buf.readBytes(bytes); + if (MessageLite.class.isAssignableFrom(clazz)) { + //native deserialize + try { + return clazz.getDeclaredMethod("parseFrom", byte[].class).invoke(clazz, bytes); + } catch (InvocationTargetException | NoSuchMethodException | IllegalAccessException e) { + throw new RuntimeException(e); + } + } else { + //protostuff + return ProtostuffUtils.deserialize(bytes, clazz); + } + } + }; + } + + private Encoder createEncoder(Class clazz, Encoder blacklistEncoder) { + if (clazz == null) { + throw new IllegalArgumentException("class to create protobuf encoder can not be null"); + } + return new Encoder() { + @Override + public ByteBuf encode(Object in) throws IOException { + //use blacklistEncoder + if (protobufBlacklist.contains(clazz.getName())) { + return blacklistEncoder.encode(in); + } + + ByteBuf out = ByteBufAllocator.DEFAULT.buffer(); + if (MessageLite.class.isAssignableFrom(clazz)) { + //native serialize + out.writeBytes(((MessageLite) in).toByteArray()); + } else { + //protostuff + out.writeBytes(ProtostuffUtils.serialize(in)); + } + return out; + } + }; + } + + private static class ProtostuffUtils { + + @SuppressWarnings("unchecked") + public static byte[] serialize(T obj) { + LinkedBuffer buffer = LinkedBuffer.allocate(LinkedBuffer.DEFAULT_BUFFER_SIZE); + try { + return ProtostuffIOUtil.toByteArray(obj, RuntimeSchema.getSchema((Class) obj.getClass()), buffer); + } finally { + buffer.clear(); + } + } + + public static T deserialize(byte[] data, Class clazz) { + Schema schema = RuntimeSchema.getSchema(clazz); + T obj = schema.newMessage(); + ProtostuffIOUtil.mergeFrom(data, obj, schema); + return obj; + } + + } + + private abstract static class BasicSerializerFactoryConcreteGetter extends BasicSerializerFactory { + protected BasicSerializerFactoryConcreteGetter(SerializerFactoryConfig config) { + super(config); + } + + private static Set getConcreteKeySet() { + Set concreteKeySet = new HashSet<>(); + if (_concrete != null && !_concrete.isEmpty()) { + concreteKeySet.addAll(_concrete.keySet()); + } + if (_concreteLazy != null && !_concreteLazy.isEmpty()) { + concreteKeySet.addAll(_concreteLazy.keySet()); + } + return concreteKeySet; + } + } +} \ No newline at end of file diff --git a/redisson/src/test/java/org/redisson/RedissonCodecTest.java b/redisson/src/test/java/org/redisson/RedissonCodecTest.java index a08008ef7..3a70f0e99 100644 --- a/redisson/src/test/java/org/redisson/RedissonCodecTest.java +++ b/redisson/src/test/java/org/redisson/RedissonCodecTest.java @@ -3,15 +3,20 @@ package org.redisson; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.dataformat.avro.AvroMapper; import com.fasterxml.jackson.dataformat.avro.AvroSchema; +import com.google.protobuf.ByteString; import io.netty.buffer.ByteBuf; import net.bytebuddy.utility.RandomString; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.redisson.api.RBucket; +import org.redisson.api.RList; import org.redisson.api.RMap; import org.redisson.api.RedissonClient; import org.redisson.client.codec.Codec; import org.redisson.codec.*; +import org.redisson.codec.protobuf.nativeData.Proto2AllTypes; +import org.redisson.codec.protobuf.nativeData.Proto3AllTypes; +import org.redisson.codec.protobuf.protostuffData.StuffData; import org.redisson.config.Config; import java.io.IOException; @@ -28,10 +33,14 @@ public class RedissonCodecTest extends BaseTest { private Codec fstCodec = new FstCodec(); private Codec snappyCodec = new SnappyCodec(); private Codec snappyCodecV2 = new SnappyCodecV2(); -// private Codec msgPackCodec = new MsgPackJacksonCodec(); + // private Codec msgPackCodec = new MsgPackJacksonCodec(); private Codec lz4Codec = new LZ4Codec(); private Codec jsonListOfStringCodec = new TypedJsonJacksonCodec( - new TypeReference() {}, new TypeReference>() {}); + new TypeReference() {}, new TypeReference>() {}); + private Codec protobufV2Codec = new ProtobufCodec(String.class, Proto2AllTypes.AllTypes2.class); + private Codec protobufV3Codec = new ProtobufCodec(String.class, Proto3AllTypes.AllTypes3.class,new JsonJacksonCodec()); + private Codec protobufStuffDataCodec = new ProtobufCodec( StuffData.class); + @Test public void testLZ4() { @@ -140,6 +149,89 @@ public class RedissonCodecTest extends BaseTest { test(redisson); } + @Test + public void testProtobufV2() { + //native V2 + Config config = createConfig(); + config.setCodec(protobufV2Codec); + RedissonClient redisson = Redisson.create(config); + final Proto2AllTypes.AllTypes2 allTypes2 = Proto2AllTypes.AllTypes2.newBuilder() + .addDoubleType(1) + .addDoubleType(1.1) + .setFloatType(1.1f) + .setInt32Type(1) + .setInt64Type(1) + .setUint32Type(1) + .setUint64Type(1) + .setSint32Type(1) + .setSint64Type(1) + .setFixed32Type(1) + .setFixed64Type(1) + .setSfixed32Type(1) + .setSfixed64Type(1) + .setBoolType(true) + .setStringType("1") + .setBytesType(ByteString.copyFrom("1".getBytes())) + .build(); + final RMap v2rMap = redisson.getMap("protobuf2Map"); + v2rMap.put("V2",allTypes2); + final Proto2AllTypes.AllTypes2 getAllTypes2 = v2rMap.get("V2"); + Assertions.assertEquals(allTypes2, getAllTypes2); + redisson.shutdown(); + } + + @Test + public void testProtobufV3() { + //native V3 + Config config = createConfig(); + config.setCodec(protobufV3Codec); + RedissonClient redisson = Redisson.create(config); + final Proto3AllTypes.AllTypes3 allTypes3 = Proto3AllTypes.AllTypes3.newBuilder() + .addDoubleType(1.1) + .addDoubleType(1.2) + .setFloatType(1.1f) + .setInt32Type(1) + .setInt64Type(1) + .setUint32Type(1) + .setUint64Type(1) + .setSint32Type(1) + .setSint64Type(1) + .setFixed32Type(1) + .setFixed64Type(1) + .setSfixed32Type(1) + .setSfixed64Type(1) + .setBoolType(true) + .setStringType("1") + .setBytesType(ByteString.copyFrom("1".getBytes())) + .build(); + final RMap v3rMap = redisson.getMap("protobuf3Map"); + v3rMap.put("V3",allTypes3); + final Proto3AllTypes.AllTypes3 getAllTypes3 = v3rMap.get("V3"); + Assertions.assertEquals(allTypes3, getAllTypes3); + redisson.shutdown(); + } + + @Test + public void testProtostuff() { + //protostuff (a framework that bypasses the need to compile .proto files into .java file.) + Config config = createConfig(); + config.setCodec(protobufStuffDataCodec); + RedissonClient redisson = Redisson.create(config); + final StuffData stuffData = new StuffData(); + stuffData.setAge(18); + List hobbies = new ArrayList<>(); + hobbies.add("game"); + hobbies.add("game"); + stuffData.setHobbies(hobbies); + stuffData.setName("ccc"); + RList protostuffList = redisson.getList("protostuffList"); + protostuffList.add(stuffData); + final StuffData getStuffData = protostuffList.get(0); + Assertions.assertEquals(stuffData, getStuffData); + redisson.shutdown(); + } + + @Test public void testKryo() { Config config = createConfig(); diff --git a/redisson/src/test/java/org/redisson/codec/protobuf/ProtobufCodecTest.java b/redisson/src/test/java/org/redisson/codec/protobuf/ProtobufCodecTest.java new file mode 100644 index 000000000..47c87934e --- /dev/null +++ b/redisson/src/test/java/org/redisson/codec/protobuf/ProtobufCodecTest.java @@ -0,0 +1,103 @@ +package org.redisson.codec.protobuf; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; +import io.netty.buffer.ByteBuf; +import io.protostuff.ProtostuffIOUtil; +import io.protostuff.Schema; +import io.protostuff.runtime.RuntimeSchema; +import org.jetbrains.annotations.NotNull; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.redisson.client.protocol.Encoder; +import org.redisson.codec.Kryo5Codec; +import org.redisson.codec.ProtobufCodec; +import org.redisson.codec.protobuf.protostuffData.StuffData; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; + +public class ProtobufCodecTest { + + @Test + public void testBlacklist() throws IOException { + Class stuffDataClass = StuffData.class; + ProtobufCodec protobufCodec = new ProtobufCodec(stuffDataClass); + Encoder valueEncoder = protobufCodec.getValueEncoder(); + + //classes in blacklist will not be serialized using protobuf ,but instead will use blacklistCodec + protobufCodec.addBlacklist(stuffDataClass); + final StuffData stuffData = getStuffData(); + ByteBuf buf = valueEncoder.encode(stuffData); + byte[] jsonBytes = new byte[buf.readableBytes()]; + buf.readBytes(jsonBytes); + Assertions.assertTrue(isValidJson(new String(jsonBytes))); + + //classes not in blacklist will be serialized using protobuf + protobufCodec.removeBlacklist(stuffDataClass); + buf = valueEncoder.encode(stuffData); + byte[] protobufBytes = new byte[buf.readableBytes()]; + buf.readBytes(protobufBytes); + StuffData desStuffData = deserializeProtobufBytes(protobufBytes, StuffData.class); + Assertions.assertEquals(stuffData, desStuffData); + } + + @Test + public void testBlacklistCodec() throws IOException { + Class stuffDataClass = StuffData.class; + + //default blacklistCodec is JsonJacksonCodec + ProtobufCodec protobufCodec = new ProtobufCodec(stuffDataClass); + protobufCodec.addBlacklist(stuffDataClass); + ByteBuf buf = protobufCodec.getValueEncoder().encode(getStuffData()); + byte[] jsonBytes = new byte[buf.readableBytes()]; + buf.readBytes(jsonBytes); + Assertions.assertTrue(isValidJson(new String(jsonBytes))); + + //replace default blacklistCodec with Kryo5Codec + Kryo5Codec kryo5Codec = new Kryo5Codec(); + protobufCodec = new ProtobufCodec(String.class, kryo5Codec); + LinkedHashSet v11 = new LinkedHashSet<>(); + v11.add("123"); + ByteBuf v1 = protobufCodec.getValueEncoder().encode(v11); + LinkedHashSet v11_1 = (LinkedHashSet) kryo5Codec.getValueDecoder().decode(v1, null); + Assertions.assertTrue(v11_1.size() == 1 && v11_1.contains("123")); + + //illegal blacklistCodec + Assertions.assertThrows(IllegalArgumentException.class + , () -> new ProtobufCodec(stuffDataClass, new ProtobufCodec(stuffDataClass)) + , "BlacklistCodec can not be ProtobufCodec"); + } + + private T deserializeProtobufBytes(byte[] data, Class clazz) { + Schema schema = RuntimeSchema.getSchema(clazz); + T obj = schema.newMessage(); + ProtostuffIOUtil.mergeFrom(data, obj, schema); + return obj; + } + + @NotNull + private StuffData getStuffData() { + final StuffData stuffData = new StuffData(); + stuffData.setAge(18); + List hobbies = new ArrayList<>(); + hobbies.add("game"); + hobbies.add("game"); + stuffData.setHobbies(hobbies); + stuffData.setName("ccc"); + return stuffData; + } + + private boolean isValidJson(String jsonString) { + ObjectMapper objectMapper = new ObjectMapper(); + try { + objectMapper.readTree(jsonString); + return true; + } catch (JsonProcessingException e) { + return false; + } + } + +} diff --git a/redisson/src/test/java/org/redisson/codec/protobuf/nativeData/Proto2AllTypes.java b/redisson/src/test/java/org/redisson/codec/protobuf/nativeData/Proto2AllTypes.java new file mode 100644 index 000000000..62c2ba8c1 --- /dev/null +++ b/redisson/src/test/java/org/redisson/codec/protobuf/nativeData/Proto2AllTypes.java @@ -0,0 +1,2200 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto2AllTypes.proto + +package org.redisson.codec.protobuf.nativeData; + +public final class Proto2AllTypes { + private Proto2AllTypes() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface AllTypes2OrBuilder extends + // @@protoc_insertion_point(interface_extends:org.redisson.codec.protobuf.raw.AllTypes2) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     *types from https://protobuf.dev/programming-guides/proto2/
+     * 
+ * + * repeated double doubleType = 1; + * @return A list containing the doubleType. + */ + java.util.List getDoubleTypeList(); + /** + *
+     *types from https://protobuf.dev/programming-guides/proto2/
+     * 
+ * + * repeated double doubleType = 1; + * @return The count of doubleType. + */ + int getDoubleTypeCount(); + /** + *
+     *types from https://protobuf.dev/programming-guides/proto2/
+     * 
+ * + * repeated double doubleType = 1; + * @param index The index of the element to return. + * @return The doubleType at the given index. + */ + double getDoubleType(int index); + + /** + * optional float floatType = 2; + * @return Whether the floatType field is set. + */ + boolean hasFloatType(); + /** + * optional float floatType = 2; + * @return The floatType. + */ + float getFloatType(); + + /** + * required int32 int32Type = 3; + * @return Whether the int32Type field is set. + */ + boolean hasInt32Type(); + /** + * required int32 int32Type = 3; + * @return The int32Type. + */ + int getInt32Type(); + + /** + * optional int64 int64Type = 4; + * @return Whether the int64Type field is set. + */ + boolean hasInt64Type(); + /** + * optional int64 int64Type = 4; + * @return The int64Type. + */ + long getInt64Type(); + + /** + * optional uint32 uint32Type = 5; + * @return Whether the uint32Type field is set. + */ + boolean hasUint32Type(); + /** + * optional uint32 uint32Type = 5; + * @return The uint32Type. + */ + int getUint32Type(); + + /** + * optional uint64 uint64Type = 6; + * @return Whether the uint64Type field is set. + */ + boolean hasUint64Type(); + /** + * optional uint64 uint64Type = 6; + * @return The uint64Type. + */ + long getUint64Type(); + + /** + * optional sint32 sint32Type = 7; + * @return Whether the sint32Type field is set. + */ + boolean hasSint32Type(); + /** + * optional sint32 sint32Type = 7; + * @return The sint32Type. + */ + int getSint32Type(); + + /** + * optional sint64 sint64Type = 8; + * @return Whether the sint64Type field is set. + */ + boolean hasSint64Type(); + /** + * optional sint64 sint64Type = 8; + * @return The sint64Type. + */ + long getSint64Type(); + + /** + * optional fixed32 fixed32Type = 9; + * @return Whether the fixed32Type field is set. + */ + boolean hasFixed32Type(); + /** + * optional fixed32 fixed32Type = 9; + * @return The fixed32Type. + */ + int getFixed32Type(); + + /** + * optional fixed64 fixed64Type = 10; + * @return Whether the fixed64Type field is set. + */ + boolean hasFixed64Type(); + /** + * optional fixed64 fixed64Type = 10; + * @return The fixed64Type. + */ + long getFixed64Type(); + + /** + * optional sfixed32 sfixed32Type = 11; + * @return Whether the sfixed32Type field is set. + */ + boolean hasSfixed32Type(); + /** + * optional sfixed32 sfixed32Type = 11; + * @return The sfixed32Type. + */ + int getSfixed32Type(); + + /** + * optional sfixed64 sfixed64Type = 12; + * @return Whether the sfixed64Type field is set. + */ + boolean hasSfixed64Type(); + /** + * optional sfixed64 sfixed64Type = 12; + * @return The sfixed64Type. + */ + long getSfixed64Type(); + + /** + * optional bool boolType = 13; + * @return Whether the boolType field is set. + */ + boolean hasBoolType(); + /** + * optional bool boolType = 13; + * @return The boolType. + */ + boolean getBoolType(); + + /** + * optional string stringType = 14; + * @return Whether the stringType field is set. + */ + boolean hasStringType(); + /** + * optional string stringType = 14; + * @return The stringType. + */ + String getStringType(); + /** + * optional string stringType = 14; + * @return The bytes for stringType. + */ + com.google.protobuf.ByteString + getStringTypeBytes(); + + /** + * optional bytes bytesType = 15; + * @return Whether the bytesType field is set. + */ + boolean hasBytesType(); + /** + * optional bytes bytesType = 15; + * @return The bytesType. + */ + com.google.protobuf.ByteString getBytesType(); + } + /** + * Protobuf type {@code org.redisson.codec.protobuf.raw.AllTypes2} + */ + public static final class AllTypes2 extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.redisson.codec.protobuf.raw.AllTypes2) + AllTypes2OrBuilder { + private static final long serialVersionUID = 0L; + // Use AllTypes2.newBuilder() to construct. + private AllTypes2(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AllTypes2() { + doubleType_ = emptyDoubleList(); + stringType_ = ""; + bytesType_ = com.google.protobuf.ByteString.EMPTY; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new AllTypes2(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AllTypes2( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new 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 9: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + doubleType_ = newDoubleList(); + mutable_bitField0_ |= 0x00000001; + } + doubleType_.addDouble(input.readDouble()); + break; + } + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { + doubleType_ = newDoubleList(); + mutable_bitField0_ |= 0x00000001; + } + while (input.getBytesUntilLimit() > 0) { + doubleType_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } + case 21: { + bitField0_ |= 0x00000001; + floatType_ = input.readFloat(); + break; + } + case 24: { + bitField0_ |= 0x00000002; + int32Type_ = input.readInt32(); + break; + } + case 32: { + bitField0_ |= 0x00000004; + int64Type_ = input.readInt64(); + break; + } + case 40: { + bitField0_ |= 0x00000008; + uint32Type_ = input.readUInt32(); + break; + } + case 48: { + bitField0_ |= 0x00000010; + uint64Type_ = input.readUInt64(); + break; + } + case 56: { + bitField0_ |= 0x00000020; + sint32Type_ = input.readSInt32(); + break; + } + case 64: { + bitField0_ |= 0x00000040; + sint64Type_ = input.readSInt64(); + break; + } + case 77: { + bitField0_ |= 0x00000080; + fixed32Type_ = input.readFixed32(); + break; + } + case 81: { + bitField0_ |= 0x00000100; + fixed64Type_ = input.readFixed64(); + break; + } + case 93: { + bitField0_ |= 0x00000200; + sfixed32Type_ = input.readSFixed32(); + break; + } + case 97: { + bitField0_ |= 0x00000400; + sfixed64Type_ = input.readSFixed64(); + break; + } + case 104: { + bitField0_ |= 0x00000800; + boolType_ = input.readBool(); + break; + } + case 114: { + com.google.protobuf.ByteString bs = input.readBytes(); + bitField0_ |= 0x00001000; + stringType_ = bs; + break; + } + case 122: { + bitField0_ |= 0x00002000; + bytesType_ = input.readBytes(); + 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_ & 0x00000001) != 0)) { + doubleType_.makeImmutable(); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Proto2AllTypes.internal_static_org_redisson_codec_protobuf_raw_AllTypes2_descriptor; + } + + @Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return Proto2AllTypes.internal_static_org_redisson_codec_protobuf_raw_AllTypes2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + AllTypes2.class, Builder.class); + } + + private int bitField0_; + public static final int DOUBLETYPE_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.DoubleList doubleType_; + /** + *
+     *types from https://protobuf.dev/programming-guides/proto2/
+     * 
+ * + * repeated double doubleType = 1; + * @return A list containing the doubleType. + */ + @Override + public java.util.List + getDoubleTypeList() { + return doubleType_; + } + /** + *
+     *types from https://protobuf.dev/programming-guides/proto2/
+     * 
+ * + * repeated double doubleType = 1; + * @return The count of doubleType. + */ + public int getDoubleTypeCount() { + return doubleType_.size(); + } + /** + *
+     *types from https://protobuf.dev/programming-guides/proto2/
+     * 
+ * + * repeated double doubleType = 1; + * @param index The index of the element to return. + * @return The doubleType at the given index. + */ + public double getDoubleType(int index) { + return doubleType_.getDouble(index); + } + + public static final int FLOATTYPE_FIELD_NUMBER = 2; + private float floatType_; + /** + * optional float floatType = 2; + * @return Whether the floatType field is set. + */ + @Override + public boolean hasFloatType() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional float floatType = 2; + * @return The floatType. + */ + @Override + public float getFloatType() { + return floatType_; + } + + public static final int INT32TYPE_FIELD_NUMBER = 3; + private int int32Type_; + /** + * required int32 int32Type = 3; + * @return Whether the int32Type field is set. + */ + @Override + public boolean hasInt32Type() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * required int32 int32Type = 3; + * @return The int32Type. + */ + @Override + public int getInt32Type() { + return int32Type_; + } + + public static final int INT64TYPE_FIELD_NUMBER = 4; + private long int64Type_; + /** + * optional int64 int64Type = 4; + * @return Whether the int64Type field is set. + */ + @Override + public boolean hasInt64Type() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * optional int64 int64Type = 4; + * @return The int64Type. + */ + @Override + public long getInt64Type() { + return int64Type_; + } + + public static final int UINT32TYPE_FIELD_NUMBER = 5; + private int uint32Type_; + /** + * optional uint32 uint32Type = 5; + * @return Whether the uint32Type field is set. + */ + @Override + public boolean hasUint32Type() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional uint32 uint32Type = 5; + * @return The uint32Type. + */ + @Override + public int getUint32Type() { + return uint32Type_; + } + + public static final int UINT64TYPE_FIELD_NUMBER = 6; + private long uint64Type_; + /** + * optional uint64 uint64Type = 6; + * @return Whether the uint64Type field is set. + */ + @Override + public boolean hasUint64Type() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional uint64 uint64Type = 6; + * @return The uint64Type. + */ + @Override + public long getUint64Type() { + return uint64Type_; + } + + public static final int SINT32TYPE_FIELD_NUMBER = 7; + private int sint32Type_; + /** + * optional sint32 sint32Type = 7; + * @return Whether the sint32Type field is set. + */ + @Override + public boolean hasSint32Type() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional sint32 sint32Type = 7; + * @return The sint32Type. + */ + @Override + public int getSint32Type() { + return sint32Type_; + } + + public static final int SINT64TYPE_FIELD_NUMBER = 8; + private long sint64Type_; + /** + * optional sint64 sint64Type = 8; + * @return Whether the sint64Type field is set. + */ + @Override + public boolean hasSint64Type() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * optional sint64 sint64Type = 8; + * @return The sint64Type. + */ + @Override + public long getSint64Type() { + return sint64Type_; + } + + public static final int FIXED32TYPE_FIELD_NUMBER = 9; + private int fixed32Type_; + /** + * optional fixed32 fixed32Type = 9; + * @return Whether the fixed32Type field is set. + */ + @Override + public boolean hasFixed32Type() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * optional fixed32 fixed32Type = 9; + * @return The fixed32Type. + */ + @Override + public int getFixed32Type() { + return fixed32Type_; + } + + public static final int FIXED64TYPE_FIELD_NUMBER = 10; + private long fixed64Type_; + /** + * optional fixed64 fixed64Type = 10; + * @return Whether the fixed64Type field is set. + */ + @Override + public boolean hasFixed64Type() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * optional fixed64 fixed64Type = 10; + * @return The fixed64Type. + */ + @Override + public long getFixed64Type() { + return fixed64Type_; + } + + public static final int SFIXED32TYPE_FIELD_NUMBER = 11; + private int sfixed32Type_; + /** + * optional sfixed32 sfixed32Type = 11; + * @return Whether the sfixed32Type field is set. + */ + @Override + public boolean hasSfixed32Type() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * optional sfixed32 sfixed32Type = 11; + * @return The sfixed32Type. + */ + @Override + public int getSfixed32Type() { + return sfixed32Type_; + } + + public static final int SFIXED64TYPE_FIELD_NUMBER = 12; + private long sfixed64Type_; + /** + * optional sfixed64 sfixed64Type = 12; + * @return Whether the sfixed64Type field is set. + */ + @Override + public boolean hasSfixed64Type() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * optional sfixed64 sfixed64Type = 12; + * @return The sfixed64Type. + */ + @Override + public long getSfixed64Type() { + return sfixed64Type_; + } + + public static final int BOOLTYPE_FIELD_NUMBER = 13; + private boolean boolType_; + /** + * optional bool boolType = 13; + * @return Whether the boolType field is set. + */ + @Override + public boolean hasBoolType() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * optional bool boolType = 13; + * @return The boolType. + */ + @Override + public boolean getBoolType() { + return boolType_; + } + + public static final int STRINGTYPE_FIELD_NUMBER = 14; + private volatile Object stringType_; + /** + * optional string stringType = 14; + * @return Whether the stringType field is set. + */ + @Override + public boolean hasStringType() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * optional string stringType = 14; + * @return The stringType. + */ + @Override + public String getStringType() { + Object ref = stringType_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + stringType_ = s; + } + return s; + } + } + /** + * optional string stringType = 14; + * @return The bytes for stringType. + */ + @Override + public com.google.protobuf.ByteString + getStringTypeBytes() { + Object ref = stringType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + stringType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BYTESTYPE_FIELD_NUMBER = 15; + private com.google.protobuf.ByteString bytesType_; + /** + * optional bytes bytesType = 15; + * @return Whether the bytesType field is set. + */ + @Override + public boolean hasBytesType() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * optional bytes bytesType = 15; + * @return The bytesType. + */ + @Override + public com.google.protobuf.ByteString getBytesType() { + return bytesType_; + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasInt32Type()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < doubleType_.size(); i++) { + output.writeDouble(1, doubleType_.getDouble(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeFloat(2, floatType_); + } + if (((bitField0_ & 0x00000002) != 0)) { + output.writeInt32(3, int32Type_); + } + if (((bitField0_ & 0x00000004) != 0)) { + output.writeInt64(4, int64Type_); + } + if (((bitField0_ & 0x00000008) != 0)) { + output.writeUInt32(5, uint32Type_); + } + if (((bitField0_ & 0x00000010) != 0)) { + output.writeUInt64(6, uint64Type_); + } + if (((bitField0_ & 0x00000020) != 0)) { + output.writeSInt32(7, sint32Type_); + } + if (((bitField0_ & 0x00000040) != 0)) { + output.writeSInt64(8, sint64Type_); + } + if (((bitField0_ & 0x00000080) != 0)) { + output.writeFixed32(9, fixed32Type_); + } + if (((bitField0_ & 0x00000100) != 0)) { + output.writeFixed64(10, fixed64Type_); + } + if (((bitField0_ & 0x00000200) != 0)) { + output.writeSFixed32(11, sfixed32Type_); + } + if (((bitField0_ & 0x00000400) != 0)) { + output.writeSFixed64(12, sfixed64Type_); + } + if (((bitField0_ & 0x00000800) != 0)) { + output.writeBool(13, boolType_); + } + if (((bitField0_ & 0x00001000) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, stringType_); + } + if (((bitField0_ & 0x00002000) != 0)) { + output.writeBytes(15, bytesType_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 8 * getDoubleTypeList().size(); + size += dataSize; + size += 1 * getDoubleTypeList().size(); + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, floatType_); + } + if (((bitField0_ & 0x00000002) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, int32Type_); + } + if (((bitField0_ & 0x00000004) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, int64Type_); + } + if (((bitField0_ & 0x00000008) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, uint32Type_); + } + if (((bitField0_ & 0x00000010) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(6, uint64Type_); + } + if (((bitField0_ & 0x00000020) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSInt32Size(7, sint32Type_); + } + if (((bitField0_ & 0x00000040) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSInt64Size(8, sint64Type_); + } + if (((bitField0_ & 0x00000080) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFixed32Size(9, fixed32Type_); + } + if (((bitField0_ & 0x00000100) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFixed64Size(10, fixed64Type_); + } + if (((bitField0_ & 0x00000200) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed32Size(11, sfixed32Type_); + } + if (((bitField0_ & 0x00000400) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed64Size(12, sfixed64Type_); + } + if (((bitField0_ & 0x00000800) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(13, boolType_); + } + if (((bitField0_ & 0x00001000) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, stringType_); + } + if (((bitField0_ & 0x00002000) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(15, bytesType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof AllTypes2)) { + return super.equals(obj); + } + AllTypes2 other = (AllTypes2) obj; + + if (!getDoubleTypeList() + .equals(other.getDoubleTypeList())) return false; + if (hasFloatType() != other.hasFloatType()) return false; + if (hasFloatType()) { + if (Float.floatToIntBits(getFloatType()) + != Float.floatToIntBits( + other.getFloatType())) return false; + } + if (hasInt32Type() != other.hasInt32Type()) return false; + if (hasInt32Type()) { + if (getInt32Type() + != other.getInt32Type()) return false; + } + if (hasInt64Type() != other.hasInt64Type()) return false; + if (hasInt64Type()) { + if (getInt64Type() + != other.getInt64Type()) return false; + } + if (hasUint32Type() != other.hasUint32Type()) return false; + if (hasUint32Type()) { + if (getUint32Type() + != other.getUint32Type()) return false; + } + if (hasUint64Type() != other.hasUint64Type()) return false; + if (hasUint64Type()) { + if (getUint64Type() + != other.getUint64Type()) return false; + } + if (hasSint32Type() != other.hasSint32Type()) return false; + if (hasSint32Type()) { + if (getSint32Type() + != other.getSint32Type()) return false; + } + if (hasSint64Type() != other.hasSint64Type()) return false; + if (hasSint64Type()) { + if (getSint64Type() + != other.getSint64Type()) return false; + } + if (hasFixed32Type() != other.hasFixed32Type()) return false; + if (hasFixed32Type()) { + if (getFixed32Type() + != other.getFixed32Type()) return false; + } + if (hasFixed64Type() != other.hasFixed64Type()) return false; + if (hasFixed64Type()) { + if (getFixed64Type() + != other.getFixed64Type()) return false; + } + if (hasSfixed32Type() != other.hasSfixed32Type()) return false; + if (hasSfixed32Type()) { + if (getSfixed32Type() + != other.getSfixed32Type()) return false; + } + if (hasSfixed64Type() != other.hasSfixed64Type()) return false; + if (hasSfixed64Type()) { + if (getSfixed64Type() + != other.getSfixed64Type()) return false; + } + if (hasBoolType() != other.hasBoolType()) return false; + if (hasBoolType()) { + if (getBoolType() + != other.getBoolType()) return false; + } + if (hasStringType() != other.hasStringType()) return false; + if (hasStringType()) { + if (!getStringType() + .equals(other.getStringType())) return false; + } + if (hasBytesType() != other.hasBytesType()) return false; + if (hasBytesType()) { + if (!getBytesType() + .equals(other.getBytesType())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDoubleTypeCount() > 0) { + hash = (37 * hash) + DOUBLETYPE_FIELD_NUMBER; + hash = (53 * hash) + getDoubleTypeList().hashCode(); + } + if (hasFloatType()) { + hash = (37 * hash) + FLOATTYPE_FIELD_NUMBER; + hash = (53 * hash) + Float.floatToIntBits( + getFloatType()); + } + if (hasInt32Type()) { + hash = (37 * hash) + INT32TYPE_FIELD_NUMBER; + hash = (53 * hash) + getInt32Type(); + } + if (hasInt64Type()) { + hash = (37 * hash) + INT64TYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getInt64Type()); + } + if (hasUint32Type()) { + hash = (37 * hash) + UINT32TYPE_FIELD_NUMBER; + hash = (53 * hash) + getUint32Type(); + } + if (hasUint64Type()) { + hash = (37 * hash) + UINT64TYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getUint64Type()); + } + if (hasSint32Type()) { + hash = (37 * hash) + SINT32TYPE_FIELD_NUMBER; + hash = (53 * hash) + getSint32Type(); + } + if (hasSint64Type()) { + hash = (37 * hash) + SINT64TYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSint64Type()); + } + if (hasFixed32Type()) { + hash = (37 * hash) + FIXED32TYPE_FIELD_NUMBER; + hash = (53 * hash) + getFixed32Type(); + } + if (hasFixed64Type()) { + hash = (37 * hash) + FIXED64TYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFixed64Type()); + } + if (hasSfixed32Type()) { + hash = (37 * hash) + SFIXED32TYPE_FIELD_NUMBER; + hash = (53 * hash) + getSfixed32Type(); + } + if (hasSfixed64Type()) { + hash = (37 * hash) + SFIXED64TYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSfixed64Type()); + } + if (hasBoolType()) { + hash = (37 * hash) + BOOLTYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getBoolType()); + } + if (hasStringType()) { + hash = (37 * hash) + STRINGTYPE_FIELD_NUMBER; + hash = (53 * hash) + getStringType().hashCode(); + } + if (hasBytesType()) { + hash = (37 * hash) + BYTESTYPE_FIELD_NUMBER; + hash = (53 * hash) + getBytesType().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static AllTypes2 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static AllTypes2 parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static AllTypes2 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static AllTypes2 parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static AllTypes2 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static AllTypes2 parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static AllTypes2 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static AllTypes2 parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static AllTypes2 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static AllTypes2 parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static AllTypes2 parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static AllTypes2 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AllTypes2 prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.redisson.codec.protobuf.raw.AllTypes2} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.redisson.codec.protobuf.raw.AllTypes2) + AllTypes2OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Proto2AllTypes.internal_static_org_redisson_codec_protobuf_raw_AllTypes2_descriptor; + } + + @Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return Proto2AllTypes.internal_static_org_redisson_codec_protobuf_raw_AllTypes2_fieldAccessorTable + .ensureFieldAccessorsInitialized( + AllTypes2.class, Builder.class); + } + + // Construct using org.redisson.codec.protobuf.raw.Proto2AllTypes.AllTypes2.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @Override + public Builder clear() { + super.clear(); + doubleType_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000001); + floatType_ = 0F; + bitField0_ = (bitField0_ & ~0x00000002); + int32Type_ = 0; + bitField0_ = (bitField0_ & ~0x00000004); + int64Type_ = 0L; + bitField0_ = (bitField0_ & ~0x00000008); + uint32Type_ = 0; + bitField0_ = (bitField0_ & ~0x00000010); + uint64Type_ = 0L; + bitField0_ = (bitField0_ & ~0x00000020); + sint32Type_ = 0; + bitField0_ = (bitField0_ & ~0x00000040); + sint64Type_ = 0L; + bitField0_ = (bitField0_ & ~0x00000080); + fixed32Type_ = 0; + bitField0_ = (bitField0_ & ~0x00000100); + fixed64Type_ = 0L; + bitField0_ = (bitField0_ & ~0x00000200); + sfixed32Type_ = 0; + bitField0_ = (bitField0_ & ~0x00000400); + sfixed64Type_ = 0L; + bitField0_ = (bitField0_ & ~0x00000800); + boolType_ = false; + bitField0_ = (bitField0_ & ~0x00001000); + stringType_ = ""; + bitField0_ = (bitField0_ & ~0x00002000); + bytesType_ = com.google.protobuf.ByteString.EMPTY; + bitField0_ = (bitField0_ & ~0x00004000); + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return Proto2AllTypes.internal_static_org_redisson_codec_protobuf_raw_AllTypes2_descriptor; + } + + @Override + public AllTypes2 getDefaultInstanceForType() { + return AllTypes2.getDefaultInstance(); + } + + @Override + public AllTypes2 build() { + AllTypes2 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public AllTypes2 buildPartial() { + AllTypes2 result = new AllTypes2(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) != 0)) { + doubleType_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.doubleType_ = doubleType_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.floatType_ = floatType_; + to_bitField0_ |= 0x00000001; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.int32Type_ = int32Type_; + to_bitField0_ |= 0x00000002; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.int64Type_ = int64Type_; + to_bitField0_ |= 0x00000004; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.uint32Type_ = uint32Type_; + to_bitField0_ |= 0x00000008; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.uint64Type_ = uint64Type_; + to_bitField0_ |= 0x00000010; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.sint32Type_ = sint32Type_; + to_bitField0_ |= 0x00000020; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.sint64Type_ = sint64Type_; + to_bitField0_ |= 0x00000040; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.fixed32Type_ = fixed32Type_; + to_bitField0_ |= 0x00000080; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.fixed64Type_ = fixed64Type_; + to_bitField0_ |= 0x00000100; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.sfixed32Type_ = sfixed32Type_; + to_bitField0_ |= 0x00000200; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.sfixed64Type_ = sfixed64Type_; + to_bitField0_ |= 0x00000400; + } + if (((from_bitField0_ & 0x00001000) != 0)) { + result.boolType_ = boolType_; + to_bitField0_ |= 0x00000800; + } + if (((from_bitField0_ & 0x00002000) != 0)) { + to_bitField0_ |= 0x00001000; + } + result.stringType_ = stringType_; + if (((from_bitField0_ & 0x00004000) != 0)) { + to_bitField0_ |= 0x00002000; + } + result.bytesType_ = bytesType_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof AllTypes2) { + return mergeFrom((AllTypes2)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(AllTypes2 other) { + if (other == AllTypes2.getDefaultInstance()) return this; + if (!other.doubleType_.isEmpty()) { + if (doubleType_.isEmpty()) { + doubleType_ = other.doubleType_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDoubleTypeIsMutable(); + doubleType_.addAll(other.doubleType_); + } + onChanged(); + } + if (other.hasFloatType()) { + setFloatType(other.getFloatType()); + } + if (other.hasInt32Type()) { + setInt32Type(other.getInt32Type()); + } + if (other.hasInt64Type()) { + setInt64Type(other.getInt64Type()); + } + if (other.hasUint32Type()) { + setUint32Type(other.getUint32Type()); + } + if (other.hasUint64Type()) { + setUint64Type(other.getUint64Type()); + } + if (other.hasSint32Type()) { + setSint32Type(other.getSint32Type()); + } + if (other.hasSint64Type()) { + setSint64Type(other.getSint64Type()); + } + if (other.hasFixed32Type()) { + setFixed32Type(other.getFixed32Type()); + } + if (other.hasFixed64Type()) { + setFixed64Type(other.getFixed64Type()); + } + if (other.hasSfixed32Type()) { + setSfixed32Type(other.getSfixed32Type()); + } + if (other.hasSfixed64Type()) { + setSfixed64Type(other.getSfixed64Type()); + } + if (other.hasBoolType()) { + setBoolType(other.getBoolType()); + } + if (other.hasStringType()) { + bitField0_ |= 0x00002000; + stringType_ = other.stringType_; + onChanged(); + } + if (other.hasBytesType()) { + setBytesType(other.getBytesType()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + if (!hasInt32Type()) { + return false; + } + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + AllTypes2 parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (AllTypes2) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.DoubleList doubleType_ = emptyDoubleList(); + private void ensureDoubleTypeIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + doubleType_ = mutableCopy(doubleType_); + bitField0_ |= 0x00000001; + } + } + /** + *
+       *types from https://protobuf.dev/programming-guides/proto2/
+       * 
+ * + * repeated double doubleType = 1; + * @return A list containing the doubleType. + */ + public java.util.List + getDoubleTypeList() { + return ((bitField0_ & 0x00000001) != 0) ? + java.util.Collections.unmodifiableList(doubleType_) : doubleType_; + } + /** + *
+       *types from https://protobuf.dev/programming-guides/proto2/
+       * 
+ * + * repeated double doubleType = 1; + * @return The count of doubleType. + */ + public int getDoubleTypeCount() { + return doubleType_.size(); + } + /** + *
+       *types from https://protobuf.dev/programming-guides/proto2/
+       * 
+ * + * repeated double doubleType = 1; + * @param index The index of the element to return. + * @return The doubleType at the given index. + */ + public double getDoubleType(int index) { + return doubleType_.getDouble(index); + } + /** + *
+       *types from https://protobuf.dev/programming-guides/proto2/
+       * 
+ * + * repeated double doubleType = 1; + * @param index The index to set the value at. + * @param value The doubleType to set. + * @return This builder for chaining. + */ + public Builder setDoubleType( + int index, double value) { + ensureDoubleTypeIsMutable(); + doubleType_.setDouble(index, value); + onChanged(); + return this; + } + /** + *
+       *types from https://protobuf.dev/programming-guides/proto2/
+       * 
+ * + * repeated double doubleType = 1; + * @param value The doubleType to add. + * @return This builder for chaining. + */ + public Builder addDoubleType(double value) { + ensureDoubleTypeIsMutable(); + doubleType_.addDouble(value); + onChanged(); + return this; + } + /** + *
+       *types from https://protobuf.dev/programming-guides/proto2/
+       * 
+ * + * repeated double doubleType = 1; + * @param values The doubleType to add. + * @return This builder for chaining. + */ + public Builder addAllDoubleType( + Iterable values) { + ensureDoubleTypeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, doubleType_); + onChanged(); + return this; + } + /** + *
+       *types from https://protobuf.dev/programming-guides/proto2/
+       * 
+ * + * repeated double doubleType = 1; + * @return This builder for chaining. + */ + public Builder clearDoubleType() { + doubleType_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + private float floatType_ ; + /** + * optional float floatType = 2; + * @return Whether the floatType field is set. + */ + @Override + public boolean hasFloatType() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * optional float floatType = 2; + * @return The floatType. + */ + @Override + public float getFloatType() { + return floatType_; + } + /** + * optional float floatType = 2; + * @param value The floatType to set. + * @return This builder for chaining. + */ + public Builder setFloatType(float value) { + bitField0_ |= 0x00000002; + floatType_ = value; + onChanged(); + return this; + } + /** + * optional float floatType = 2; + * @return This builder for chaining. + */ + public Builder clearFloatType() { + bitField0_ = (bitField0_ & ~0x00000002); + floatType_ = 0F; + onChanged(); + return this; + } + + private int int32Type_ ; + /** + * required int32 int32Type = 3; + * @return Whether the int32Type field is set. + */ + @Override + public boolean hasInt32Type() { + return ((bitField0_ & 0x00000004) != 0); + } + /** + * required int32 int32Type = 3; + * @return The int32Type. + */ + @Override + public int getInt32Type() { + return int32Type_; + } + /** + * required int32 int32Type = 3; + * @param value The int32Type to set. + * @return This builder for chaining. + */ + public Builder setInt32Type(int value) { + bitField0_ |= 0x00000004; + int32Type_ = value; + onChanged(); + return this; + } + /** + * required int32 int32Type = 3; + * @return This builder for chaining. + */ + public Builder clearInt32Type() { + bitField0_ = (bitField0_ & ~0x00000004); + int32Type_ = 0; + onChanged(); + return this; + } + + private long int64Type_ ; + /** + * optional int64 int64Type = 4; + * @return Whether the int64Type field is set. + */ + @Override + public boolean hasInt64Type() { + return ((bitField0_ & 0x00000008) != 0); + } + /** + * optional int64 int64Type = 4; + * @return The int64Type. + */ + @Override + public long getInt64Type() { + return int64Type_; + } + /** + * optional int64 int64Type = 4; + * @param value The int64Type to set. + * @return This builder for chaining. + */ + public Builder setInt64Type(long value) { + bitField0_ |= 0x00000008; + int64Type_ = value; + onChanged(); + return this; + } + /** + * optional int64 int64Type = 4; + * @return This builder for chaining. + */ + public Builder clearInt64Type() { + bitField0_ = (bitField0_ & ~0x00000008); + int64Type_ = 0L; + onChanged(); + return this; + } + + private int uint32Type_ ; + /** + * optional uint32 uint32Type = 5; + * @return Whether the uint32Type field is set. + */ + @Override + public boolean hasUint32Type() { + return ((bitField0_ & 0x00000010) != 0); + } + /** + * optional uint32 uint32Type = 5; + * @return The uint32Type. + */ + @Override + public int getUint32Type() { + return uint32Type_; + } + /** + * optional uint32 uint32Type = 5; + * @param value The uint32Type to set. + * @return This builder for chaining. + */ + public Builder setUint32Type(int value) { + bitField0_ |= 0x00000010; + uint32Type_ = value; + onChanged(); + return this; + } + /** + * optional uint32 uint32Type = 5; + * @return This builder for chaining. + */ + public Builder clearUint32Type() { + bitField0_ = (bitField0_ & ~0x00000010); + uint32Type_ = 0; + onChanged(); + return this; + } + + private long uint64Type_ ; + /** + * optional uint64 uint64Type = 6; + * @return Whether the uint64Type field is set. + */ + @Override + public boolean hasUint64Type() { + return ((bitField0_ & 0x00000020) != 0); + } + /** + * optional uint64 uint64Type = 6; + * @return The uint64Type. + */ + @Override + public long getUint64Type() { + return uint64Type_; + } + /** + * optional uint64 uint64Type = 6; + * @param value The uint64Type to set. + * @return This builder for chaining. + */ + public Builder setUint64Type(long value) { + bitField0_ |= 0x00000020; + uint64Type_ = value; + onChanged(); + return this; + } + /** + * optional uint64 uint64Type = 6; + * @return This builder for chaining. + */ + public Builder clearUint64Type() { + bitField0_ = (bitField0_ & ~0x00000020); + uint64Type_ = 0L; + onChanged(); + return this; + } + + private int sint32Type_ ; + /** + * optional sint32 sint32Type = 7; + * @return Whether the sint32Type field is set. + */ + @Override + public boolean hasSint32Type() { + return ((bitField0_ & 0x00000040) != 0); + } + /** + * optional sint32 sint32Type = 7; + * @return The sint32Type. + */ + @Override + public int getSint32Type() { + return sint32Type_; + } + /** + * optional sint32 sint32Type = 7; + * @param value The sint32Type to set. + * @return This builder for chaining. + */ + public Builder setSint32Type(int value) { + bitField0_ |= 0x00000040; + sint32Type_ = value; + onChanged(); + return this; + } + /** + * optional sint32 sint32Type = 7; + * @return This builder for chaining. + */ + public Builder clearSint32Type() { + bitField0_ = (bitField0_ & ~0x00000040); + sint32Type_ = 0; + onChanged(); + return this; + } + + private long sint64Type_ ; + /** + * optional sint64 sint64Type = 8; + * @return Whether the sint64Type field is set. + */ + @Override + public boolean hasSint64Type() { + return ((bitField0_ & 0x00000080) != 0); + } + /** + * optional sint64 sint64Type = 8; + * @return The sint64Type. + */ + @Override + public long getSint64Type() { + return sint64Type_; + } + /** + * optional sint64 sint64Type = 8; + * @param value The sint64Type to set. + * @return This builder for chaining. + */ + public Builder setSint64Type(long value) { + bitField0_ |= 0x00000080; + sint64Type_ = value; + onChanged(); + return this; + } + /** + * optional sint64 sint64Type = 8; + * @return This builder for chaining. + */ + public Builder clearSint64Type() { + bitField0_ = (bitField0_ & ~0x00000080); + sint64Type_ = 0L; + onChanged(); + return this; + } + + private int fixed32Type_ ; + /** + * optional fixed32 fixed32Type = 9; + * @return Whether the fixed32Type field is set. + */ + @Override + public boolean hasFixed32Type() { + return ((bitField0_ & 0x00000100) != 0); + } + /** + * optional fixed32 fixed32Type = 9; + * @return The fixed32Type. + */ + @Override + public int getFixed32Type() { + return fixed32Type_; + } + /** + * optional fixed32 fixed32Type = 9; + * @param value The fixed32Type to set. + * @return This builder for chaining. + */ + public Builder setFixed32Type(int value) { + bitField0_ |= 0x00000100; + fixed32Type_ = value; + onChanged(); + return this; + } + /** + * optional fixed32 fixed32Type = 9; + * @return This builder for chaining. + */ + public Builder clearFixed32Type() { + bitField0_ = (bitField0_ & ~0x00000100); + fixed32Type_ = 0; + onChanged(); + return this; + } + + private long fixed64Type_ ; + /** + * optional fixed64 fixed64Type = 10; + * @return Whether the fixed64Type field is set. + */ + @Override + public boolean hasFixed64Type() { + return ((bitField0_ & 0x00000200) != 0); + } + /** + * optional fixed64 fixed64Type = 10; + * @return The fixed64Type. + */ + @Override + public long getFixed64Type() { + return fixed64Type_; + } + /** + * optional fixed64 fixed64Type = 10; + * @param value The fixed64Type to set. + * @return This builder for chaining. + */ + public Builder setFixed64Type(long value) { + bitField0_ |= 0x00000200; + fixed64Type_ = value; + onChanged(); + return this; + } + /** + * optional fixed64 fixed64Type = 10; + * @return This builder for chaining. + */ + public Builder clearFixed64Type() { + bitField0_ = (bitField0_ & ~0x00000200); + fixed64Type_ = 0L; + onChanged(); + return this; + } + + private int sfixed32Type_ ; + /** + * optional sfixed32 sfixed32Type = 11; + * @return Whether the sfixed32Type field is set. + */ + @Override + public boolean hasSfixed32Type() { + return ((bitField0_ & 0x00000400) != 0); + } + /** + * optional sfixed32 sfixed32Type = 11; + * @return The sfixed32Type. + */ + @Override + public int getSfixed32Type() { + return sfixed32Type_; + } + /** + * optional sfixed32 sfixed32Type = 11; + * @param value The sfixed32Type to set. + * @return This builder for chaining. + */ + public Builder setSfixed32Type(int value) { + bitField0_ |= 0x00000400; + sfixed32Type_ = value; + onChanged(); + return this; + } + /** + * optional sfixed32 sfixed32Type = 11; + * @return This builder for chaining. + */ + public Builder clearSfixed32Type() { + bitField0_ = (bitField0_ & ~0x00000400); + sfixed32Type_ = 0; + onChanged(); + return this; + } + + private long sfixed64Type_ ; + /** + * optional sfixed64 sfixed64Type = 12; + * @return Whether the sfixed64Type field is set. + */ + @Override + public boolean hasSfixed64Type() { + return ((bitField0_ & 0x00000800) != 0); + } + /** + * optional sfixed64 sfixed64Type = 12; + * @return The sfixed64Type. + */ + @Override + public long getSfixed64Type() { + return sfixed64Type_; + } + /** + * optional sfixed64 sfixed64Type = 12; + * @param value The sfixed64Type to set. + * @return This builder for chaining. + */ + public Builder setSfixed64Type(long value) { + bitField0_ |= 0x00000800; + sfixed64Type_ = value; + onChanged(); + return this; + } + /** + * optional sfixed64 sfixed64Type = 12; + * @return This builder for chaining. + */ + public Builder clearSfixed64Type() { + bitField0_ = (bitField0_ & ~0x00000800); + sfixed64Type_ = 0L; + onChanged(); + return this; + } + + private boolean boolType_ ; + /** + * optional bool boolType = 13; + * @return Whether the boolType field is set. + */ + @Override + public boolean hasBoolType() { + return ((bitField0_ & 0x00001000) != 0); + } + /** + * optional bool boolType = 13; + * @return The boolType. + */ + @Override + public boolean getBoolType() { + return boolType_; + } + /** + * optional bool boolType = 13; + * @param value The boolType to set. + * @return This builder for chaining. + */ + public Builder setBoolType(boolean value) { + bitField0_ |= 0x00001000; + boolType_ = value; + onChanged(); + return this; + } + /** + * optional bool boolType = 13; + * @return This builder for chaining. + */ + public Builder clearBoolType() { + bitField0_ = (bitField0_ & ~0x00001000); + boolType_ = false; + onChanged(); + return this; + } + + private Object stringType_ = ""; + /** + * optional string stringType = 14; + * @return Whether the stringType field is set. + */ + public boolean hasStringType() { + return ((bitField0_ & 0x00002000) != 0); + } + /** + * optional string stringType = 14; + * @return The stringType. + */ + public String getStringType() { + Object ref = stringType_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + stringType_ = s; + } + return s; + } else { + return (String) ref; + } + } + /** + * optional string stringType = 14; + * @return The bytes for stringType. + */ + public com.google.protobuf.ByteString + getStringTypeBytes() { + Object ref = stringType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + stringType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string stringType = 14; + * @param value The stringType to set. + * @return This builder for chaining. + */ + public Builder setStringType( + String value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00002000; + stringType_ = value; + onChanged(); + return this; + } + /** + * optional string stringType = 14; + * @return This builder for chaining. + */ + public Builder clearStringType() { + bitField0_ = (bitField0_ & ~0x00002000); + stringType_ = getDefaultInstance().getStringType(); + onChanged(); + return this; + } + /** + * optional string stringType = 14; + * @param value The bytes for stringType to set. + * @return This builder for chaining. + */ + public Builder setStringTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00002000; + stringType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString bytesType_ = com.google.protobuf.ByteString.EMPTY; + /** + * optional bytes bytesType = 15; + * @return Whether the bytesType field is set. + */ + @Override + public boolean hasBytesType() { + return ((bitField0_ & 0x00004000) != 0); + } + /** + * optional bytes bytesType = 15; + * @return The bytesType. + */ + @Override + public com.google.protobuf.ByteString getBytesType() { + return bytesType_; + } + /** + * optional bytes bytesType = 15; + * @param value The bytesType to set. + * @return This builder for chaining. + */ + public Builder setBytesType(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00004000; + bytesType_ = value; + onChanged(); + return this; + } + /** + * optional bytes bytesType = 15; + * @return This builder for chaining. + */ + public Builder clearBytesType() { + bitField0_ = (bitField0_ & ~0x00004000); + bytesType_ = getDefaultInstance().getBytesType(); + onChanged(); + return this; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.redisson.codec.protobuf.raw.AllTypes2) + } + + // @@protoc_insertion_point(class_scope:org.redisson.codec.protobuf.raw.AllTypes2) + private static final AllTypes2 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AllTypes2(); + } + + public static AllTypes2 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public AllTypes2 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AllTypes2(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public AllTypes2 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_redisson_codec_protobuf_raw_AllTypes2_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_redisson_codec_protobuf_raw_AllTypes2_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + String[] descriptorData = { + "\n\024proto2AllTypes.proto\022\037org.redisson.cod" + + "ec.protobuf.raw\"\267\002\n\tAllTypes2\022\022\n\ndoubleT" + + "ype\030\001 \003(\001\022\021\n\tfloatType\030\002 \001(\002\022\021\n\tint32Typ" + + "e\030\003 \002(\005\022\021\n\tint64Type\030\004 \001(\003\022\022\n\nuint32Type" + + "\030\005 \001(\r\022\022\n\nuint64Type\030\006 \001(\004\022\022\n\nsint32Type" + + "\030\007 \001(\021\022\022\n\nsint64Type\030\010 \001(\022\022\023\n\013fixed32Typ" + + "e\030\t \001(\007\022\023\n\013fixed64Type\030\n \001(\006\022\024\n\014sfixed32" + + "Type\030\013 \001(\017\022\024\n\014sfixed64Type\030\014 \001(\020\022\020\n\010bool" + + "Type\030\r \001(\010\022\022\n\nstringType\030\016 \001(\t\022\021\n\tbytesT" + + "ype\030\017 \001(\014B1\n\037org.redisson.codec.protobuf" + + ".rawB\016Proto2AllTypes" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_org_redisson_codec_protobuf_raw_AllTypes2_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_org_redisson_codec_protobuf_raw_AllTypes2_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_redisson_codec_protobuf_raw_AllTypes2_descriptor, + new String[] { "DoubleType", "FloatType", "Int32Type", "Int64Type", "Uint32Type", "Uint64Type", "Sint32Type", "Sint64Type", "Fixed32Type", "Fixed64Type", "Sfixed32Type", "Sfixed64Type", "BoolType", "StringType", "BytesType", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/redisson/src/test/java/org/redisson/codec/protobuf/nativeData/Proto3AllTypes.java b/redisson/src/test/java/org/redisson/codec/protobuf/nativeData/Proto3AllTypes.java new file mode 100644 index 000000000..aaef272a8 --- /dev/null +++ b/redisson/src/test/java/org/redisson/codec/protobuf/nativeData/Proto3AllTypes.java @@ -0,0 +1,1825 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto3AllTypes.proto + +package org.redisson.codec.protobuf.nativeData; + +public final class Proto3AllTypes { + private Proto3AllTypes() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface AllTypes3OrBuilder extends + // @@protoc_insertion_point(interface_extends:org.redisson.codec.protobuf.raw.AllTypes3) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     *types from https://protobuf.dev/programming-guides/proto3/
+     * 
+ * + * repeated double doubleType = 1; + * @return A list containing the doubleType. + */ + java.util.List getDoubleTypeList(); + /** + *
+     *types from https://protobuf.dev/programming-guides/proto3/
+     * 
+ * + * repeated double doubleType = 1; + * @return The count of doubleType. + */ + int getDoubleTypeCount(); + /** + *
+     *types from https://protobuf.dev/programming-guides/proto3/
+     * 
+ * + * repeated double doubleType = 1; + * @param index The index of the element to return. + * @return The doubleType at the given index. + */ + double getDoubleType(int index); + + /** + * float floatType = 2; + * @return Whether the floatType field is set. + */ + boolean hasFloatType(); + /** + * float floatType = 2; + * @return The floatType. + */ + float getFloatType(); + + /** + * int32 int32Type = 3; + * @return The int32Type. + */ + int getInt32Type(); + + /** + * int64 int64Type = 4; + * @return The int64Type. + */ + long getInt64Type(); + + /** + * uint32 uint32Type = 5; + * @return The uint32Type. + */ + int getUint32Type(); + + /** + * uint64 uint64Type = 6; + * @return The uint64Type. + */ + long getUint64Type(); + + /** + * sint32 sint32Type = 7; + * @return The sint32Type. + */ + int getSint32Type(); + + /** + * sint64 sint64Type = 8; + * @return The sint64Type. + */ + long getSint64Type(); + + /** + * fixed32 fixed32Type = 9; + * @return The fixed32Type. + */ + int getFixed32Type(); + + /** + * fixed64 fixed64Type = 10; + * @return The fixed64Type. + */ + long getFixed64Type(); + + /** + * sfixed32 sfixed32Type = 11; + * @return The sfixed32Type. + */ + int getSfixed32Type(); + + /** + * sfixed64 sfixed64Type = 12; + * @return The sfixed64Type. + */ + long getSfixed64Type(); + + /** + * bool boolType = 13; + * @return The boolType. + */ + boolean getBoolType(); + + /** + * string stringType = 14; + * @return The stringType. + */ + String getStringType(); + /** + * string stringType = 14; + * @return The bytes for stringType. + */ + com.google.protobuf.ByteString + getStringTypeBytes(); + + /** + * bytes bytesType = 15; + * @return The bytesType. + */ + com.google.protobuf.ByteString getBytesType(); + } + /** + * Protobuf type {@code org.redisson.codec.protobuf.raw.AllTypes3} + */ + public static final class AllTypes3 extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:org.redisson.codec.protobuf.raw.AllTypes3) + AllTypes3OrBuilder { + private static final long serialVersionUID = 0L; + // Use AllTypes3.newBuilder() to construct. + private AllTypes3(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private AllTypes3() { + doubleType_ = emptyDoubleList(); + stringType_ = ""; + bytesType_ = com.google.protobuf.ByteString.EMPTY; + } + + @Override + @SuppressWarnings({"unused"}) + protected Object newInstance( + UnusedPrivateParameter unused) { + return new AllTypes3(); + } + + @Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private AllTypes3( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new 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 9: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + doubleType_ = newDoubleList(); + mutable_bitField0_ |= 0x00000001; + } + doubleType_.addDouble(input.readDouble()); + break; + } + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + if (!((mutable_bitField0_ & 0x00000001) != 0) && input.getBytesUntilLimit() > 0) { + doubleType_ = newDoubleList(); + mutable_bitField0_ |= 0x00000001; + } + while (input.getBytesUntilLimit() > 0) { + doubleType_.addDouble(input.readDouble()); + } + input.popLimit(limit); + break; + } + case 21: { + bitField0_ |= 0x00000001; + floatType_ = input.readFloat(); + break; + } + case 24: { + + int32Type_ = input.readInt32(); + break; + } + case 32: { + + int64Type_ = input.readInt64(); + break; + } + case 40: { + + uint32Type_ = input.readUInt32(); + break; + } + case 48: { + + uint64Type_ = input.readUInt64(); + break; + } + case 56: { + + sint32Type_ = input.readSInt32(); + break; + } + case 64: { + + sint64Type_ = input.readSInt64(); + break; + } + case 77: { + + fixed32Type_ = input.readFixed32(); + break; + } + case 81: { + + fixed64Type_ = input.readFixed64(); + break; + } + case 93: { + + sfixed32Type_ = input.readSFixed32(); + break; + } + case 97: { + + sfixed64Type_ = input.readSFixed64(); + break; + } + case 104: { + + boolType_ = input.readBool(); + break; + } + case 114: { + String s = input.readStringRequireUtf8(); + + stringType_ = s; + break; + } + case 122: { + + bytesType_ = input.readBytes(); + 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_ & 0x00000001) != 0)) { + doubleType_.makeImmutable(); // C + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Proto3AllTypes.internal_static_org_redisson_codec_protobuf_raw_AllTypes3_descriptor; + } + + @Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return Proto3AllTypes.internal_static_org_redisson_codec_protobuf_raw_AllTypes3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + AllTypes3.class, Builder.class); + } + + private int bitField0_; + public static final int DOUBLETYPE_FIELD_NUMBER = 1; + private com.google.protobuf.Internal.DoubleList doubleType_; + /** + *
+     *types from https://protobuf.dev/programming-guides/proto3/
+     * 
+ * + * repeated double doubleType = 1; + * @return A list containing the doubleType. + */ + @Override + public java.util.List + getDoubleTypeList() { + return doubleType_; + } + /** + *
+     *types from https://protobuf.dev/programming-guides/proto3/
+     * 
+ * + * repeated double doubleType = 1; + * @return The count of doubleType. + */ + public int getDoubleTypeCount() { + return doubleType_.size(); + } + /** + *
+     *types from https://protobuf.dev/programming-guides/proto3/
+     * 
+ * + * repeated double doubleType = 1; + * @param index The index of the element to return. + * @return The doubleType at the given index. + */ + public double getDoubleType(int index) { + return doubleType_.getDouble(index); + } + private int doubleTypeMemoizedSerializedSize = -1; + + public static final int FLOATTYPE_FIELD_NUMBER = 2; + private float floatType_; + /** + * float floatType = 2; + * @return Whether the floatType field is set. + */ + @Override + public boolean hasFloatType() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * float floatType = 2; + * @return The floatType. + */ + @Override + public float getFloatType() { + return floatType_; + } + + public static final int INT32TYPE_FIELD_NUMBER = 3; + private int int32Type_; + /** + * int32 int32Type = 3; + * @return The int32Type. + */ + @Override + public int getInt32Type() { + return int32Type_; + } + + public static final int INT64TYPE_FIELD_NUMBER = 4; + private long int64Type_; + /** + * int64 int64Type = 4; + * @return The int64Type. + */ + @Override + public long getInt64Type() { + return int64Type_; + } + + public static final int UINT32TYPE_FIELD_NUMBER = 5; + private int uint32Type_; + /** + * uint32 uint32Type = 5; + * @return The uint32Type. + */ + @Override + public int getUint32Type() { + return uint32Type_; + } + + public static final int UINT64TYPE_FIELD_NUMBER = 6; + private long uint64Type_; + /** + * uint64 uint64Type = 6; + * @return The uint64Type. + */ + @Override + public long getUint64Type() { + return uint64Type_; + } + + public static final int SINT32TYPE_FIELD_NUMBER = 7; + private int sint32Type_; + /** + * sint32 sint32Type = 7; + * @return The sint32Type. + */ + @Override + public int getSint32Type() { + return sint32Type_; + } + + public static final int SINT64TYPE_FIELD_NUMBER = 8; + private long sint64Type_; + /** + * sint64 sint64Type = 8; + * @return The sint64Type. + */ + @Override + public long getSint64Type() { + return sint64Type_; + } + + public static final int FIXED32TYPE_FIELD_NUMBER = 9; + private int fixed32Type_; + /** + * fixed32 fixed32Type = 9; + * @return The fixed32Type. + */ + @Override + public int getFixed32Type() { + return fixed32Type_; + } + + public static final int FIXED64TYPE_FIELD_NUMBER = 10; + private long fixed64Type_; + /** + * fixed64 fixed64Type = 10; + * @return The fixed64Type. + */ + @Override + public long getFixed64Type() { + return fixed64Type_; + } + + public static final int SFIXED32TYPE_FIELD_NUMBER = 11; + private int sfixed32Type_; + /** + * sfixed32 sfixed32Type = 11; + * @return The sfixed32Type. + */ + @Override + public int getSfixed32Type() { + return sfixed32Type_; + } + + public static final int SFIXED64TYPE_FIELD_NUMBER = 12; + private long sfixed64Type_; + /** + * sfixed64 sfixed64Type = 12; + * @return The sfixed64Type. + */ + @Override + public long getSfixed64Type() { + return sfixed64Type_; + } + + public static final int BOOLTYPE_FIELD_NUMBER = 13; + private boolean boolType_; + /** + * bool boolType = 13; + * @return The boolType. + */ + @Override + public boolean getBoolType() { + return boolType_; + } + + public static final int STRINGTYPE_FIELD_NUMBER = 14; + private volatile Object stringType_; + /** + * string stringType = 14; + * @return The stringType. + */ + @Override + public String getStringType() { + Object ref = stringType_; + if (ref instanceof String) { + return (String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + stringType_ = s; + return s; + } + } + /** + * string stringType = 14; + * @return The bytes for stringType. + */ + @Override + public com.google.protobuf.ByteString + getStringTypeBytes() { + Object ref = stringType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + stringType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int BYTESTYPE_FIELD_NUMBER = 15; + private com.google.protobuf.ByteString bytesType_; + /** + * bytes bytesType = 15; + * @return The bytesType. + */ + @Override + public com.google.protobuf.ByteString getBytesType() { + return bytesType_; + } + + private byte memoizedIsInitialized = -1; + @Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (getDoubleTypeList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(doubleTypeMemoizedSerializedSize); + } + for (int i = 0; i < doubleType_.size(); i++) { + output.writeDoubleNoTag(doubleType_.getDouble(i)); + } + if (((bitField0_ & 0x00000001) != 0)) { + output.writeFloat(2, floatType_); + } + if (int32Type_ != 0) { + output.writeInt32(3, int32Type_); + } + if (int64Type_ != 0L) { + output.writeInt64(4, int64Type_); + } + if (uint32Type_ != 0) { + output.writeUInt32(5, uint32Type_); + } + if (uint64Type_ != 0L) { + output.writeUInt64(6, uint64Type_); + } + if (sint32Type_ != 0) { + output.writeSInt32(7, sint32Type_); + } + if (sint64Type_ != 0L) { + output.writeSInt64(8, sint64Type_); + } + if (fixed32Type_ != 0) { + output.writeFixed32(9, fixed32Type_); + } + if (fixed64Type_ != 0L) { + output.writeFixed64(10, fixed64Type_); + } + if (sfixed32Type_ != 0) { + output.writeSFixed32(11, sfixed32Type_); + } + if (sfixed64Type_ != 0L) { + output.writeSFixed64(12, sfixed64Type_); + } + if (boolType_ != false) { + output.writeBool(13, boolType_); + } + if (!getStringTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 14, stringType_); + } + if (!bytesType_.isEmpty()) { + output.writeBytes(15, bytesType_); + } + unknownFields.writeTo(output); + } + + @Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + dataSize = 8 * getDoubleTypeList().size(); + size += dataSize; + if (!getDoubleTypeList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + doubleTypeMemoizedSerializedSize = dataSize; + } + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeFloatSize(2, floatType_); + } + if (int32Type_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, int32Type_); + } + if (int64Type_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, int64Type_); + } + if (uint32Type_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeUInt32Size(5, uint32Type_); + } + if (uint64Type_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeUInt64Size(6, uint64Type_); + } + if (sint32Type_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeSInt32Size(7, sint32Type_); + } + if (sint64Type_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeSInt64Size(8, sint64Type_); + } + if (fixed32Type_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeFixed32Size(9, fixed32Type_); + } + if (fixed64Type_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeFixed64Size(10, fixed64Type_); + } + if (sfixed32Type_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed32Size(11, sfixed32Type_); + } + if (sfixed64Type_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeSFixed64Size(12, sfixed64Type_); + } + if (boolType_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(13, boolType_); + } + if (!getStringTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(14, stringType_); + } + if (!bytesType_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(15, bytesType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof AllTypes3)) { + return super.equals(obj); + } + AllTypes3 other = (AllTypes3) obj; + + if (!getDoubleTypeList() + .equals(other.getDoubleTypeList())) return false; + if (hasFloatType() != other.hasFloatType()) return false; + if (hasFloatType()) { + if (Float.floatToIntBits(getFloatType()) + != Float.floatToIntBits( + other.getFloatType())) return false; + } + if (getInt32Type() + != other.getInt32Type()) return false; + if (getInt64Type() + != other.getInt64Type()) return false; + if (getUint32Type() + != other.getUint32Type()) return false; + if (getUint64Type() + != other.getUint64Type()) return false; + if (getSint32Type() + != other.getSint32Type()) return false; + if (getSint64Type() + != other.getSint64Type()) return false; + if (getFixed32Type() + != other.getFixed32Type()) return false; + if (getFixed64Type() + != other.getFixed64Type()) return false; + if (getSfixed32Type() + != other.getSfixed32Type()) return false; + if (getSfixed64Type() + != other.getSfixed64Type()) return false; + if (getBoolType() + != other.getBoolType()) return false; + if (!getStringType() + .equals(other.getStringType())) return false; + if (!getBytesType() + .equals(other.getBytesType())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getDoubleTypeCount() > 0) { + hash = (37 * hash) + DOUBLETYPE_FIELD_NUMBER; + hash = (53 * hash) + getDoubleTypeList().hashCode(); + } + if (hasFloatType()) { + hash = (37 * hash) + FLOATTYPE_FIELD_NUMBER; + hash = (53 * hash) + Float.floatToIntBits( + getFloatType()); + } + hash = (37 * hash) + INT32TYPE_FIELD_NUMBER; + hash = (53 * hash) + getInt32Type(); + hash = (37 * hash) + INT64TYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getInt64Type()); + hash = (37 * hash) + UINT32TYPE_FIELD_NUMBER; + hash = (53 * hash) + getUint32Type(); + hash = (37 * hash) + UINT64TYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getUint64Type()); + hash = (37 * hash) + SINT32TYPE_FIELD_NUMBER; + hash = (53 * hash) + getSint32Type(); + hash = (37 * hash) + SINT64TYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSint64Type()); + hash = (37 * hash) + FIXED32TYPE_FIELD_NUMBER; + hash = (53 * hash) + getFixed32Type(); + hash = (37 * hash) + FIXED64TYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getFixed64Type()); + hash = (37 * hash) + SFIXED32TYPE_FIELD_NUMBER; + hash = (53 * hash) + getSfixed32Type(); + hash = (37 * hash) + SFIXED64TYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSfixed64Type()); + hash = (37 * hash) + BOOLTYPE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getBoolType()); + hash = (37 * hash) + STRINGTYPE_FIELD_NUMBER; + hash = (53 * hash) + getStringType().hashCode(); + hash = (37 * hash) + BYTESTYPE_FIELD_NUMBER; + hash = (53 * hash) + getBytesType().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static AllTypes3 parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static AllTypes3 parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static AllTypes3 parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static AllTypes3 parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static AllTypes3 parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static AllTypes3 parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static AllTypes3 parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static AllTypes3 parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static AllTypes3 parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static AllTypes3 parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static AllTypes3 parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static AllTypes3 parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(AllTypes3 prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code org.redisson.codec.protobuf.raw.AllTypes3} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:org.redisson.codec.protobuf.raw.AllTypes3) + AllTypes3OrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return Proto3AllTypes.internal_static_org_redisson_codec_protobuf_raw_AllTypes3_descriptor; + } + + @Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return Proto3AllTypes.internal_static_org_redisson_codec_protobuf_raw_AllTypes3_fieldAccessorTable + .ensureFieldAccessorsInitialized( + AllTypes3.class, Builder.class); + } + + // Construct using org.redisson.codec.protobuf.raw.Proto3AllTypes.AllTypes3.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @Override + public Builder clear() { + super.clear(); + doubleType_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000001); + floatType_ = 0F; + bitField0_ = (bitField0_ & ~0x00000002); + int32Type_ = 0; + + int64Type_ = 0L; + + uint32Type_ = 0; + + uint64Type_ = 0L; + + sint32Type_ = 0; + + sint64Type_ = 0L; + + fixed32Type_ = 0; + + fixed64Type_ = 0L; + + sfixed32Type_ = 0; + + sfixed64Type_ = 0L; + + boolType_ = false; + + stringType_ = ""; + + bytesType_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return Proto3AllTypes.internal_static_org_redisson_codec_protobuf_raw_AllTypes3_descriptor; + } + + @Override + public AllTypes3 getDefaultInstanceForType() { + return AllTypes3.getDefaultInstance(); + } + + @Override + public AllTypes3 build() { + AllTypes3 result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @Override + public AllTypes3 buildPartial() { + AllTypes3 result = new AllTypes3(this); + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((bitField0_ & 0x00000001) != 0)) { + doubleType_.makeImmutable(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.doubleType_ = doubleType_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.floatType_ = floatType_; + to_bitField0_ |= 0x00000001; + } + result.int32Type_ = int32Type_; + result.int64Type_ = int64Type_; + result.uint32Type_ = uint32Type_; + result.uint64Type_ = uint64Type_; + result.sint32Type_ = sint32Type_; + result.sint64Type_ = sint64Type_; + result.fixed32Type_ = fixed32Type_; + result.fixed64Type_ = fixed64Type_; + result.sfixed32Type_ = sfixed32Type_; + result.sfixed64Type_ = sfixed64Type_; + result.boolType_ = boolType_; + result.stringType_ = stringType_; + result.bytesType_ = bytesType_; + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + @Override + public Builder clone() { + return super.clone(); + } + @Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.setField(field, value); + } + @Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return super.setRepeatedField(field, index, value); + } + @Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return super.addRepeatedField(field, value); + } + @Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof AllTypes3) { + return mergeFrom((AllTypes3)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(AllTypes3 other) { + if (other == AllTypes3.getDefaultInstance()) return this; + if (!other.doubleType_.isEmpty()) { + if (doubleType_.isEmpty()) { + doubleType_ = other.doubleType_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureDoubleTypeIsMutable(); + doubleType_.addAll(other.doubleType_); + } + onChanged(); + } + if (other.hasFloatType()) { + setFloatType(other.getFloatType()); + } + if (other.getInt32Type() != 0) { + setInt32Type(other.getInt32Type()); + } + if (other.getInt64Type() != 0L) { + setInt64Type(other.getInt64Type()); + } + if (other.getUint32Type() != 0) { + setUint32Type(other.getUint32Type()); + } + if (other.getUint64Type() != 0L) { + setUint64Type(other.getUint64Type()); + } + if (other.getSint32Type() != 0) { + setSint32Type(other.getSint32Type()); + } + if (other.getSint64Type() != 0L) { + setSint64Type(other.getSint64Type()); + } + if (other.getFixed32Type() != 0) { + setFixed32Type(other.getFixed32Type()); + } + if (other.getFixed64Type() != 0L) { + setFixed64Type(other.getFixed64Type()); + } + if (other.getSfixed32Type() != 0) { + setSfixed32Type(other.getSfixed32Type()); + } + if (other.getSfixed64Type() != 0L) { + setSfixed64Type(other.getSfixed64Type()); + } + if (other.getBoolType() != false) { + setBoolType(other.getBoolType()); + } + if (!other.getStringType().isEmpty()) { + stringType_ = other.stringType_; + onChanged(); + } + if (other.getBytesType() != com.google.protobuf.ByteString.EMPTY) { + setBytesType(other.getBytesType()); + } + this.mergeUnknownFields(other.unknownFields); + onChanged(); + return this; + } + + @Override + public final boolean isInitialized() { + return true; + } + + @Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + AllTypes3 parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (AllTypes3) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.DoubleList doubleType_ = emptyDoubleList(); + private void ensureDoubleTypeIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + doubleType_ = mutableCopy(doubleType_); + bitField0_ |= 0x00000001; + } + } + /** + *
+       *types from https://protobuf.dev/programming-guides/proto3/
+       * 
+ * + * repeated double doubleType = 1; + * @return A list containing the doubleType. + */ + public java.util.List + getDoubleTypeList() { + return ((bitField0_ & 0x00000001) != 0) ? + java.util.Collections.unmodifiableList(doubleType_) : doubleType_; + } + /** + *
+       *types from https://protobuf.dev/programming-guides/proto3/
+       * 
+ * + * repeated double doubleType = 1; + * @return The count of doubleType. + */ + public int getDoubleTypeCount() { + return doubleType_.size(); + } + /** + *
+       *types from https://protobuf.dev/programming-guides/proto3/
+       * 
+ * + * repeated double doubleType = 1; + * @param index The index of the element to return. + * @return The doubleType at the given index. + */ + public double getDoubleType(int index) { + return doubleType_.getDouble(index); + } + /** + *
+       *types from https://protobuf.dev/programming-guides/proto3/
+       * 
+ * + * repeated double doubleType = 1; + * @param index The index to set the value at. + * @param value The doubleType to set. + * @return This builder for chaining. + */ + public Builder setDoubleType( + int index, double value) { + ensureDoubleTypeIsMutable(); + doubleType_.setDouble(index, value); + onChanged(); + return this; + } + /** + *
+       *types from https://protobuf.dev/programming-guides/proto3/
+       * 
+ * + * repeated double doubleType = 1; + * @param value The doubleType to add. + * @return This builder for chaining. + */ + public Builder addDoubleType(double value) { + ensureDoubleTypeIsMutable(); + doubleType_.addDouble(value); + onChanged(); + return this; + } + /** + *
+       *types from https://protobuf.dev/programming-guides/proto3/
+       * 
+ * + * repeated double doubleType = 1; + * @param values The doubleType to add. + * @return This builder for chaining. + */ + public Builder addAllDoubleType( + Iterable values) { + ensureDoubleTypeIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, doubleType_); + onChanged(); + return this; + } + /** + *
+       *types from https://protobuf.dev/programming-guides/proto3/
+       * 
+ * + * repeated double doubleType = 1; + * @return This builder for chaining. + */ + public Builder clearDoubleType() { + doubleType_ = emptyDoubleList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + private float floatType_ ; + /** + * float floatType = 2; + * @return Whether the floatType field is set. + */ + @Override + public boolean hasFloatType() { + return ((bitField0_ & 0x00000002) != 0); + } + /** + * float floatType = 2; + * @return The floatType. + */ + @Override + public float getFloatType() { + return floatType_; + } + /** + * float floatType = 2; + * @param value The floatType to set. + * @return This builder for chaining. + */ + public Builder setFloatType(float value) { + bitField0_ |= 0x00000002; + floatType_ = value; + onChanged(); + return this; + } + /** + * float floatType = 2; + * @return This builder for chaining. + */ + public Builder clearFloatType() { + bitField0_ = (bitField0_ & ~0x00000002); + floatType_ = 0F; + onChanged(); + return this; + } + + private int int32Type_ ; + /** + * int32 int32Type = 3; + * @return The int32Type. + */ + @Override + public int getInt32Type() { + return int32Type_; + } + /** + * int32 int32Type = 3; + * @param value The int32Type to set. + * @return This builder for chaining. + */ + public Builder setInt32Type(int value) { + + int32Type_ = value; + onChanged(); + return this; + } + /** + * int32 int32Type = 3; + * @return This builder for chaining. + */ + public Builder clearInt32Type() { + + int32Type_ = 0; + onChanged(); + return this; + } + + private long int64Type_ ; + /** + * int64 int64Type = 4; + * @return The int64Type. + */ + @Override + public long getInt64Type() { + return int64Type_; + } + /** + * int64 int64Type = 4; + * @param value The int64Type to set. + * @return This builder for chaining. + */ + public Builder setInt64Type(long value) { + + int64Type_ = value; + onChanged(); + return this; + } + /** + * int64 int64Type = 4; + * @return This builder for chaining. + */ + public Builder clearInt64Type() { + + int64Type_ = 0L; + onChanged(); + return this; + } + + private int uint32Type_ ; + /** + * uint32 uint32Type = 5; + * @return The uint32Type. + */ + @Override + public int getUint32Type() { + return uint32Type_; + } + /** + * uint32 uint32Type = 5; + * @param value The uint32Type to set. + * @return This builder for chaining. + */ + public Builder setUint32Type(int value) { + + uint32Type_ = value; + onChanged(); + return this; + } + /** + * uint32 uint32Type = 5; + * @return This builder for chaining. + */ + public Builder clearUint32Type() { + + uint32Type_ = 0; + onChanged(); + return this; + } + + private long uint64Type_ ; + /** + * uint64 uint64Type = 6; + * @return The uint64Type. + */ + @Override + public long getUint64Type() { + return uint64Type_; + } + /** + * uint64 uint64Type = 6; + * @param value The uint64Type to set. + * @return This builder for chaining. + */ + public Builder setUint64Type(long value) { + + uint64Type_ = value; + onChanged(); + return this; + } + /** + * uint64 uint64Type = 6; + * @return This builder for chaining. + */ + public Builder clearUint64Type() { + + uint64Type_ = 0L; + onChanged(); + return this; + } + + private int sint32Type_ ; + /** + * sint32 sint32Type = 7; + * @return The sint32Type. + */ + @Override + public int getSint32Type() { + return sint32Type_; + } + /** + * sint32 sint32Type = 7; + * @param value The sint32Type to set. + * @return This builder for chaining. + */ + public Builder setSint32Type(int value) { + + sint32Type_ = value; + onChanged(); + return this; + } + /** + * sint32 sint32Type = 7; + * @return This builder for chaining. + */ + public Builder clearSint32Type() { + + sint32Type_ = 0; + onChanged(); + return this; + } + + private long sint64Type_ ; + /** + * sint64 sint64Type = 8; + * @return The sint64Type. + */ + @Override + public long getSint64Type() { + return sint64Type_; + } + /** + * sint64 sint64Type = 8; + * @param value The sint64Type to set. + * @return This builder for chaining. + */ + public Builder setSint64Type(long value) { + + sint64Type_ = value; + onChanged(); + return this; + } + /** + * sint64 sint64Type = 8; + * @return This builder for chaining. + */ + public Builder clearSint64Type() { + + sint64Type_ = 0L; + onChanged(); + return this; + } + + private int fixed32Type_ ; + /** + * fixed32 fixed32Type = 9; + * @return The fixed32Type. + */ + @Override + public int getFixed32Type() { + return fixed32Type_; + } + /** + * fixed32 fixed32Type = 9; + * @param value The fixed32Type to set. + * @return This builder for chaining. + */ + public Builder setFixed32Type(int value) { + + fixed32Type_ = value; + onChanged(); + return this; + } + /** + * fixed32 fixed32Type = 9; + * @return This builder for chaining. + */ + public Builder clearFixed32Type() { + + fixed32Type_ = 0; + onChanged(); + return this; + } + + private long fixed64Type_ ; + /** + * fixed64 fixed64Type = 10; + * @return The fixed64Type. + */ + @Override + public long getFixed64Type() { + return fixed64Type_; + } + /** + * fixed64 fixed64Type = 10; + * @param value The fixed64Type to set. + * @return This builder for chaining. + */ + public Builder setFixed64Type(long value) { + + fixed64Type_ = value; + onChanged(); + return this; + } + /** + * fixed64 fixed64Type = 10; + * @return This builder for chaining. + */ + public Builder clearFixed64Type() { + + fixed64Type_ = 0L; + onChanged(); + return this; + } + + private int sfixed32Type_ ; + /** + * sfixed32 sfixed32Type = 11; + * @return The sfixed32Type. + */ + @Override + public int getSfixed32Type() { + return sfixed32Type_; + } + /** + * sfixed32 sfixed32Type = 11; + * @param value The sfixed32Type to set. + * @return This builder for chaining. + */ + public Builder setSfixed32Type(int value) { + + sfixed32Type_ = value; + onChanged(); + return this; + } + /** + * sfixed32 sfixed32Type = 11; + * @return This builder for chaining. + */ + public Builder clearSfixed32Type() { + + sfixed32Type_ = 0; + onChanged(); + return this; + } + + private long sfixed64Type_ ; + /** + * sfixed64 sfixed64Type = 12; + * @return The sfixed64Type. + */ + @Override + public long getSfixed64Type() { + return sfixed64Type_; + } + /** + * sfixed64 sfixed64Type = 12; + * @param value The sfixed64Type to set. + * @return This builder for chaining. + */ + public Builder setSfixed64Type(long value) { + + sfixed64Type_ = value; + onChanged(); + return this; + } + /** + * sfixed64 sfixed64Type = 12; + * @return This builder for chaining. + */ + public Builder clearSfixed64Type() { + + sfixed64Type_ = 0L; + onChanged(); + return this; + } + + private boolean boolType_ ; + /** + * bool boolType = 13; + * @return The boolType. + */ + @Override + public boolean getBoolType() { + return boolType_; + } + /** + * bool boolType = 13; + * @param value The boolType to set. + * @return This builder for chaining. + */ + public Builder setBoolType(boolean value) { + + boolType_ = value; + onChanged(); + return this; + } + /** + * bool boolType = 13; + * @return This builder for chaining. + */ + public Builder clearBoolType() { + + boolType_ = false; + onChanged(); + return this; + } + + private Object stringType_ = ""; + /** + * string stringType = 14; + * @return The stringType. + */ + public String getStringType() { + Object ref = stringType_; + if (!(ref instanceof String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + String s = bs.toStringUtf8(); + stringType_ = s; + return s; + } else { + return (String) ref; + } + } + /** + * string stringType = 14; + * @return The bytes for stringType. + */ + public com.google.protobuf.ByteString + getStringTypeBytes() { + Object ref = stringType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (String) ref); + stringType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string stringType = 14; + * @param value The stringType to set. + * @return This builder for chaining. + */ + public Builder setStringType( + String value) { + if (value == null) { + throw new NullPointerException(); + } + + stringType_ = value; + onChanged(); + return this; + } + /** + * string stringType = 14; + * @return This builder for chaining. + */ + public Builder clearStringType() { + + stringType_ = getDefaultInstance().getStringType(); + onChanged(); + return this; + } + /** + * string stringType = 14; + * @param value The bytes for stringType to set. + * @return This builder for chaining. + */ + public Builder setStringTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + stringType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString bytesType_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes bytesType = 15; + * @return The bytesType. + */ + @Override + public com.google.protobuf.ByteString getBytesType() { + return bytesType_; + } + /** + * bytes bytesType = 15; + * @param value The bytesType to set. + * @return This builder for chaining. + */ + public Builder setBytesType(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + bytesType_ = value; + onChanged(); + return this; + } + /** + * bytes bytesType = 15; + * @return This builder for chaining. + */ + public Builder clearBytesType() { + + bytesType_ = getDefaultInstance().getBytesType(); + onChanged(); + return this; + } + @Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:org.redisson.codec.protobuf.raw.AllTypes3) + } + + // @@protoc_insertion_point(class_scope:org.redisson.codec.protobuf.raw.AllTypes3) + private static final AllTypes3 DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new AllTypes3(); + } + + public static AllTypes3 getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @Override + public AllTypes3 parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new AllTypes3(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @Override + public AllTypes3 getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_org_redisson_codec_protobuf_raw_AllTypes3_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_org_redisson_codec_protobuf_raw_AllTypes3_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + String[] descriptorData = { + "\n\024proto3AllTypes.proto\022\037org.redisson.cod" + + "ec.protobuf.raw\"\312\002\n\tAllTypes3\022\022\n\ndoubleT" + + "ype\030\001 \003(\001\022\026\n\tfloatType\030\002 \001(\002H\000\210\001\001\022\021\n\tint" + + "32Type\030\003 \001(\005\022\021\n\tint64Type\030\004 \001(\003\022\022\n\nuint3" + + "2Type\030\005 \001(\r\022\022\n\nuint64Type\030\006 \001(\004\022\022\n\nsint3" + + "2Type\030\007 \001(\021\022\022\n\nsint64Type\030\010 \001(\022\022\023\n\013fixed" + + "32Type\030\t \001(\007\022\023\n\013fixed64Type\030\n \001(\006\022\024\n\014sfi" + + "xed32Type\030\013 \001(\017\022\024\n\014sfixed64Type\030\014 \001(\020\022\020\n" + + "\010boolType\030\r \001(\010\022\022\n\nstringType\030\016 \001(\t\022\021\n\tb" + + "ytesType\030\017 \001(\014B\014\n\n_floatTypeB1\n\037org.redi" + + "sson.codec.protobuf.rawB\016Proto3AllTypesb" + + "\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + }); + internal_static_org_redisson_codec_protobuf_raw_AllTypes3_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_org_redisson_codec_protobuf_raw_AllTypes3_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_org_redisson_codec_protobuf_raw_AllTypes3_descriptor, + new String[] { "DoubleType", "FloatType", "Int32Type", "Int64Type", "Uint32Type", "Uint64Type", "Sint32Type", "Sint64Type", "Fixed32Type", "Fixed64Type", "Sfixed32Type", "Sfixed64Type", "BoolType", "StringType", "BytesType", "FloatType", }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/redisson/src/test/java/org/redisson/codec/protobuf/nativeData/proto2AllTypes.proto b/redisson/src/test/java/org/redisson/codec/protobuf/nativeData/proto2AllTypes.proto new file mode 100644 index 000000000..f7437298c --- /dev/null +++ b/redisson/src/test/java/org/redisson/codec/protobuf/nativeData/proto2AllTypes.proto @@ -0,0 +1,27 @@ +syntax = "proto2"; + +package org.redisson.codec.protobuf.raw; + +option java_package = "org.redisson.codec.protobuf.raw"; + +option java_outer_classname = "Proto2AllTypes"; + +message AllTypes2{ + //types from https://protobuf.dev/programming-guides/proto2/ + repeated double doubleType = 1; + optional float floatType = 2; + required int32 int32Type = 3; + optional int64 int64Type = 4; + optional uint32 uint32Type = 5; + optional uint64 uint64Type = 6; + optional sint32 sint32Type = 7; + optional sint64 sint64Type = 8; + optional fixed32 fixed32Type = 9; + optional fixed64 fixed64Type = 10; + optional sfixed32 sfixed32Type = 11; + optional sfixed64 sfixed64Type = 12; + optional bool boolType = 13; + optional string stringType = 14; + optional bytes bytesType = 15 ; +} + diff --git a/redisson/src/test/java/org/redisson/codec/protobuf/nativeData/proto3AllTypes.proto b/redisson/src/test/java/org/redisson/codec/protobuf/nativeData/proto3AllTypes.proto new file mode 100644 index 000000000..d097368ca --- /dev/null +++ b/redisson/src/test/java/org/redisson/codec/protobuf/nativeData/proto3AllTypes.proto @@ -0,0 +1,27 @@ +syntax = "proto3"; + +package org.redisson.codec.protobuf.raw; + +option java_package = "org.redisson.codec.protobuf.raw"; + +option java_outer_classname = "Proto3AllTypes"; + +message AllTypes3{ + //types from https://protobuf.dev/programming-guides/proto3/ + repeated double doubleType = 1; + optional float floatType = 2; + int32 int32Type = 3; + int64 int64Type = 4; + uint32 uint32Type = 5; + uint64 uint64Type = 6; + sint32 sint32Type = 7; + sint64 sint64Type = 8; + fixed32 fixed32Type = 9; + fixed64 fixed64Type = 10; + sfixed32 sfixed32Type = 11; + sfixed64 sfixed64Type = 12; + bool boolType = 13; + string stringType = 14; + bytes bytesType = 15 ; +} + diff --git a/redisson/src/test/java/org/redisson/codec/protobuf/protostuffData/StuffData.java b/redisson/src/test/java/org/redisson/codec/protobuf/protostuffData/StuffData.java new file mode 100644 index 000000000..da39e81d9 --- /dev/null +++ b/redisson/src/test/java/org/redisson/codec/protobuf/protostuffData/StuffData.java @@ -0,0 +1,51 @@ +package org.redisson.codec.protobuf.protostuffData; + +import java.util.List; +import java.util.Objects; + +public class StuffData { + private String name; + private int age; + private List hobbies; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getAge() { + return age; + } + + public void setAge(int age) { + this.age = age; + } + + public List getHobbies() { + return hobbies; + } + + public void setHobbies(List hobbies) { + this.hobbies = hobbies; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + StuffData stuffData = (StuffData) o; + + if (age != stuffData.age) return false; + if (!Objects.equals(name, stuffData.name)) return false; + return Objects.equals(hobbies, stuffData.hobbies); + } + + @Override + public int hashCode() { + return Objects.hash(name, age, hobbies); + } +}