class ApplicationIdCodec extends JsonCodec<ApplicationId> {

    @Override
    public ObjectNode encode(ApplicationId appId, CodecContext context) {
        checkNotNull(appId, "ApplicationId cannot be null");

        ObjectNode result = context.mapper().createObjectNode()
                .put("id", appId.id())
                .put("name", appId.name());

        return result;
    }

}