public static Long readFieldAsLong()

in src/main/java/com/epam/eco/commons/kafka/serde/jackson/JsonDeserializerUtils.java [87:107]


    public static Long readFieldAsLong(
            JsonNode node,
            String fieldName,
            boolean nullable,
            DeserializationContext context) throws JsonMappingException {
        JsonNode fieldNode = node.get(fieldName);

        if (fieldNode == null || fieldNode.isNull()) {
            if (nullable) {
                return null;
            } else {
                context.reportInputMismatch(Long.class, "% is null", fieldName);
            }
        }

        if (!fieldNode.canConvertToLong()) {
            context.reportInputMismatch(Long.class, "% is invalid", fieldName);
        }

        return fieldNode.asLong();
    }