MCPcopy Create free account
hub / github.com/e2wugui/zeze / BValue

Class BValue

ZezeJava/ZezeJava/src/main/java/Zeze/Builtin/TestRocks/BValue.java:7–600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5import Zeze.Serialize.IByteBuffer;
6
7@SuppressWarnings({"UnusedAssignment", "RedundantIfStatement", "SwitchStatementWithTooFewBranches", "RedundantSuppression", "NullableProblems", "SuspiciousNameCombination"})
8public final class BValue extends Zeze.Raft.RocksRaft.Bean {
9 public static final long TYPEID = -7620770686653123067L;
10
11 private int _Int;
12 private boolean _Bool;
13 private float _Float;
14 private double _double;
15 private String _String;
16 private Zeze.Net.Binary _Binary;
17 private final Zeze.Raft.RocksRaft.CollSet1<Integer> _SetInt;
18 private final Zeze.Raft.RocksRaft.CollSet1<Zeze.Builtin.TestRocks.BeanKey> _SetBeankey;
19 private final Zeze.Raft.RocksRaft.CollMap1<Integer, Integer> _MapInt;
20 private final Zeze.Raft.RocksRaft.CollMap2<Integer, Zeze.Builtin.TestRocks.BValue> _MapBean;
21 private Zeze.Builtin.TestRocks.BeanKey _Beankey;
22
23 private transient Object __zeze_map_key__;
24
25 @Override
26 public Object mapKey() {
27 return __zeze_map_key__;
28 }
29
30 @Override
31 public void mapKey(Object value) {
32 __zeze_map_key__ = value;
33 }
34
35 public int getInt() {
36 if (!isManaged())
37 return _Int;
38 var txn = Zeze.Raft.RocksRaft.Transaction.getCurrent();
39 if (txn == null)
40 return _Int;
41 var log = txn.getLog(objectId() + 1);
42 if (log == null)
43 return _Int;
44 return ((Zeze.Raft.RocksRaft.Log1.LogInt)log).value;
45 }
46
47 public void setInt(int value) {
48 if (!isManaged()) {
49 _Int = value;
50 return;
51 }
52 var txn = Zeze.Raft.RocksRaft.Transaction.getCurrent();
53 txn.putLog(new Zeze.Raft.RocksRaft.Log1.LogInt(this, 1, value));
54 }
55
56 public boolean isBool() {
57 if (!isManaged())
58 return _Bool;
59 var txn = Zeze.Raft.RocksRaft.Transaction.getCurrent();
60 if (txn == null)
61 return _Bool;
62 var log = txn.getLog(objectId() + 2);
63 if (log == null)
64 return _Bool;

Callers 5

__init__Method · 0.50
test_rpc_simpleMethod · 0.50
test_beanMethod · 0.50
test_dynamic_mapMethod · 0.50
TestEncodeFunction · 0.50

Calls

no outgoing calls

Tested by 5

__init__Method · 0.40
test_rpc_simpleMethod · 0.40
test_beanMethod · 0.40
test_dynamic_mapMethod · 0.40
TestEncodeFunction · 0.40