@Test public void testMastershipRoleEncode() { MastershipRole mastershipRole = MASTER; ObjectNode mastershipRoleJson = mastershipRoleCodec.encode(mastershipRole, context); assertThat(mastershipRoleJson, MastershipRoleJsonMatcher.matchesMastershipRole(mastershipRole)); }
@Override public ObjectNode encode(MastershipRole mastershipRole, CodecContext context) { checkNotNull(mastershipRole, "MastershipRole cannot be null"); ObjectNode result = context.mapper().createObjectNode() .put(ROLE, mastershipRole.name()); return result; }
MastershipRoleCodec extends JsonCodec<MastershipRole> { @Override public ObjectNode encode(MastershipRole mastershipRole, CodecContext context) { checkNotNull(mastershipRole, "MastershipRole cannot be null"); ObjectNode result = context.mapper().createObjectNode() .put(ROLE, mastershipRole.name()); return result; } }
MastershipRoleCodec extends JsonCodec<MastershipRole> { @Override public ObjectNode encode(MastershipRole mastershipRole, CodecContext context) { checkNotNull(mastershipRole, "MastershipRole cannot be null"); ObjectNode result = context.mapper().createObjectNode() .put(ROLE, mastershipRole.name()); return result; }  }
MastershipRoleCodec extends JsonCodec<MastershipRole> { @Override public ObjectNode encode(MastershipRole mastershipRole, CodecContext context) { checkNotNull(mastershipRole, "MastershipRole cannot be null"); ObjectNode result = context.mapper().createObjectNode() .put(ROLE, mastershipRole.name()); return result; }  @Override ObjectNode encode(MastershipRole mastershipRole, CodecContext context); @Override MastershipRole decode(ObjectNode json, CodecContext context); }
MastershipRoleCodec extends JsonCodec<MastershipRole> { @Override public ObjectNode encode(MastershipRole mastershipRole, CodecContext context) { checkNotNull(mastershipRole, "MastershipRole cannot be null"); ObjectNode result = context.mapper().createObjectNode() .put(ROLE, mastershipRole.name()); return result; }  @Override ObjectNode encode(MastershipRole mastershipRole, CodecContext context); @Override MastershipRole decode(ObjectNode json, CodecContext context);  }