mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-09-05 22:17:35 +00:00
fix[protocol]: compatible field of inside protocol class
This commit is contained in:
@@ -338,7 +338,9 @@ public class BenchmarkTesting {
|
||||
public static final Map<Integer, String> mapWithInteger = new HashMap<>(Map.of(Integer.MIN_VALUE, "a", -99, "b", 0, "c", 99, "d", Integer.MAX_VALUE, "e"));
|
||||
|
||||
public static final ObjectB objectB = new ObjectB(true);
|
||||
// public static final ObjectB objectB = new ObjectB(true, 44);
|
||||
public static final ObjectA objectA = new ObjectA(Integer.MAX_VALUE, mapWithInteger, objectB);
|
||||
// public static final ObjectA objectA = new ObjectA(Integer.MAX_VALUE, mapWithInteger, objectB, 66);
|
||||
public static final List<Integer> listWithInteger = new ArrayList<>(ArrayUtils.toList(intArray));
|
||||
public static final List<Integer> listWithInteger1 = new ArrayList<>(ArrayUtils.toList(intArray1));
|
||||
public static final List<Integer> listWithInteger2 = new ArrayList<>(ArrayUtils.toList(intArray2));
|
||||
|
||||
@@ -95,7 +95,8 @@ public class CompatibleTesting {
|
||||
public void normalTest() {
|
||||
var buffer = new UnpooledHeapByteBuf(ByteBufAllocator.DEFAULT, 100, 1_0000);
|
||||
ProtocolManager.write(buffer, normalObject);
|
||||
// FileUtils.writeInputStreamToFile(new File("normal-no-compatible.bytes"), new ByteArrayInputStream(ByteBufUtils.readAllBytes(buffer)));
|
||||
// normalObject.outCompatibleValue = 88;
|
||||
// FileUtils.writeInputStreamToFile(new File("normal-no-compatible.bytes"), new ByteArrayInputStream(ByteBufUtils.readAllBytes(buffer)));
|
||||
var packet = ProtocolManager.read(buffer);
|
||||
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
package com.zfoo.protocol.packet;
|
||||
|
||||
|
||||
import com.zfoo.protocol.anno.Compatible;
|
||||
import com.zfoo.protocol.anno.Protocol;
|
||||
|
||||
import java.util.List;
|
||||
@@ -57,6 +58,9 @@ public class NormalObject {
|
||||
private Set<Integer> s;
|
||||
private Set<String> ssss;
|
||||
|
||||
// @Compatible(1)
|
||||
// public int outCompatibleValue;
|
||||
|
||||
public byte getA() {
|
||||
return a;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
package com.zfoo.protocol.packet;
|
||||
|
||||
|
||||
import com.zfoo.protocol.anno.Compatible;
|
||||
import com.zfoo.protocol.anno.Protocol;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -29,5 +30,8 @@ public record ObjectA(
|
||||
Map<Integer, String> m,
|
||||
|
||||
ObjectB objectB
|
||||
|
||||
// @Compatible(1)
|
||||
// int innerCompatibleValue,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
package com.zfoo.protocol.packet;
|
||||
|
||||
|
||||
import com.zfoo.protocol.anno.Compatible;
|
||||
import com.zfoo.protocol.anno.Protocol;
|
||||
|
||||
/**
|
||||
@@ -24,6 +25,9 @@ public record ObjectB(
|
||||
|
||||
boolean flag
|
||||
|
||||
// @Compatible(1)
|
||||
// int innerCompatibleValue
|
||||
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user