@Override public void writeObject(ObjectOutput output, AuthenticationSessionModel.ExecutionStatus e) throws IOException { MarshallUtil.marshallEnum(e, output); }
@Override public void writeObject(ObjectOutput output, CounterState object) throws IOException { MarshallUtil.marshallEnum(object, output); }
@Override public void writeObject(ObjectOutput output, CacheContainerAdmin.AdminFlag flag) throws IOException { MarshallUtil.marshallEnum(flag, output); }
@Override public void writeTo(ObjectOutput output) throws IOException { MarshallUtil.marshallEnum(commandType, output); output.writeObject(queryDefinition); MarshallUtil.marshallUUID(queryId, output, true); output.writeInt(docIndex); }
@Override public void writeTo(ObjectOutput output) throws IOException { MarshallUtil.marshallEnum(commandType, output); output.writeObject(query); MarshallUtil.marshallUUID(lazyQueryId, output, true); output.writeInt(docIndex); }
@Override public void writeObject(ObjectOutput output, ClusteredLockValue object) throws IOException { MarshallUtil.marshallString(object.requestId, output); output.writeObject(object.owner); MarshallUtil.marshallEnum(object.state, output); }
static void writeObjectStatic(ObjectOutput output, SortField sortField) throws IOException { output.writeUTF(sortField.getField()); MarshallUtil.marshallEnum(sortField.getType(), output); output.writeBoolean(sortField.getReverse()); }
@Test public void testEnum() throws IOException { ObjectInputOutput io = new ObjectInputOutput(); MarshallUtil.marshallEnum(null, io); Assert.assertNull(MarshallUtil.unmarshallEnum(io, ordinal -> TestEnum.values()[ordinal])); Assert.assertEquals(0, io.buffer.size()); for (TestEnum e : TestEnum.values()) { io.reset(); MarshallUtil.marshallEnum(e, io); Assert.assertEquals(e, MarshallUtil.unmarshallEnum(io, ordinal -> TestEnum.values()[ordinal])); Assert.assertEquals(0, io.buffer.size()); } }