@Override protected boolean doEncode(DocumentMessage obj, DocumentSerializer buf) { UpdateDocumentMessage msg = (UpdateDocumentMessage)obj; if (msg.getSerializedBuffer() != null) { buf.put(null, msg.getSerializedBuffer()); } else { msg.getDocumentUpdate().serialize(buf); buf.putLong(null, msg.getOldTimestamp()); buf.putLong(null, msg.getNewTimestamp()); encodeTasCondition(buf, (TestAndSetMessage) obj); } return true; } }