public static Integer getInteger(JsonNode jsonNode, String fieldName) {
    Preconditions.checkNotNull(jsonNode, "JsonNode should not be null.");

    JsonNode valueNode = jsonNode.get(fieldName);
    if (valueNode == null) {
      return null;
    }

    if (valueNode.isInt()) {
      return valueNode.intValue();
    }
    throw new ClassCastException("can not cast to int, value : " + valueNode);
  }
Convert an java object(usually java bean) to JsonNode.
amoro-common/src/main/java/org/apache/amoro/utils/JacksonUtil.java