Package com.fasterxml.jackson.databind

Examples of com.fasterxml.jackson.databind.JsonNode.longValue()


                }

                // TODO refactor it!
                if (arg.isNumber()) {
                    if (clazz.equals(Long.class)) {
                        val = arg.longValue();
                    }
                    if (clazz.equals(BigDecimal.class)) {
                        val = arg.bigIntegerValue();
                    }
                    if (clazz.equals(Double.class)) {
View Full Code Here


       
        if (node.isInt()) {
            return valueMatcher.matches(node.intValue());
           
        } else if (node.isLong()) {
            return valueMatcher.matches(node.longValue());
           
        } else if (node.isTextual()) {
            return valueMatcher.matches(node.textValue());
           
        } else if (node.isBoolean()) {
View Full Code Here

    @Override
    public Long deserializeLong(JsonReadGenericRecord record, String fieldName) {
        JsonNode node = record.getNode().isNumber() ? record.getNode() : getJsonNode(record, fieldName);
        if (node == null)
            return null;
        return node.longValue();
    }

    @Override
    public Float deserializeFloat(JsonReadGenericRecord record, String fieldName) {
        JsonNode node = record.getNode().isNumber() ? record.getNode() : getJsonNode(record, fieldName);
View Full Code Here

                }

                // TODO refactor it!
                if (arg.isNumber()) {
                    if (clazz.equals(Long.class)) {
                        val = arg.longValue();
                    }
                    if (clazz.equals(BigDecimal.class)) {
                        val = arg.bigIntegerValue();
                    }
                    if (clazz.equals(Double.class)) {
View Full Code Here

                }

                // TODO refactor it!
                if (arg.isNumber()) {
                    if (clazz.equals(Long.class)) {
                        val = arg.longValue();
                    }
                    if (clazz.equals(BigDecimal.class)) {
                        val = arg.bigIntegerValue();
                    }
                    if (clazz.equals(Double.class)) {
View Full Code Here

    protected void validateLong(final ProcessingReport report,
        final MessageBundle bundle, final FullData data)
        throws ProcessingException
    {
        final JsonNode instance = data.getInstance().getNode();
        final long instanceValue = instance.longValue();
        final long longValue = number.longValue();

        if (instanceValue > longValue)
            return;
View Full Code Here

    protected void validateLong(final ProcessingReport report,
        final MessageBundle bundle, final FullData data)
        throws ProcessingException
    {
        final JsonNode instance = data.getInstance().getNode();
        final long instanceValue = instance.longValue();
        final long longValue = number.longValue();

        if (instanceValue < longValue)
            return;
View Full Code Here

        ret.put("valueIsLong", isLong);

        if (isLong) {
            ret.put(keyword, node.canConvertToInt()
                ? FACTORY.numberNode(node.intValue())
                : FACTORY.numberNode(node.longValue()));
            return ret;
        }

        final BigDecimal decimal = node.decimalValue();
        ret.put(keyword, decimal.scale() == 0
View Full Code Here

    protected final void validateLong(final ProcessingReport report,
        final MessageBundle bundle, final FullData data)
        throws ProcessingException
    {
        final JsonNode node = data.getInstance().getNode();
        final long instanceValue = node.longValue();
        final long longValue = number.longValue();

        final long remainder = instanceValue % longValue;

        if (remainder == 0L)
View Full Code Here

                }

                // TODO refactor it!
                if (arg.isNumber()) {
                    if (clazz.equals(Long.class)) {
                        val = arg.longValue();
                    }
                    if (clazz.equals(BigDecimal.class)) {
                        val = arg.bigIntegerValue();
                    }
                    if (clazz.equals(Double.class)) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.