class UpdateMessagePatchConverter {

    public UpdateMessagePatch fromJsonNode(ObjectNode updatePatchNode) {
        if (updatePatchNode == null || updatePatchNode.isNull() || updatePatchNode.isMissingNode()) {
            throw new IllegalArgumentException("updatePatchNode");
        }
        if (! validator.isValid(updatePatchNode)) {
            return UpdateMessagePatch.builder()
                    .validationResult(validator.validate(updatePatchNode))
                    .build();
        }
        try {
            return jsonParser.readerFor(UpdateMessagePatch.class).<UpdateMessagePatch>readValue(updatePatchNode);
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    @Inject @VisibleForTesting  UpdateMessagePatchConverter(ObjectMapper jsonParser, UpdateMessagePatchValidator validator);

}