コード例 #1
0
 @Override
 public void write(Kryo kryo, Output output, MastershipTerm object) {
   kryo.writeClassAndObject(output, object.master());
   output.writeInt(object.termNumber());
 }
コード例 #2
0
 @Override
 public MastershipTerm read(Kryo kryo, Input input, Class<MastershipTerm> type) {
   final NodeId node = (NodeId) kryo.readClassAndObject(input);
   final int term = input.readInt();
   return MastershipTerm.of(node, term);
 }