All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.testifyproject.fasterxml.jackson.databind.node.NumericNode Maven / Gradle / Ivy

There is a newer version: 1.0.0
Show newest version
package org.testifyproject.testifyproject.fasterxml.jackson.databind.node;

import java.math.BigDecimal;
import java.math.BigInteger;

import org.testifyproject.testifyproject.fasterxml.jackson.core.JsonParser;

/**
 * Intermediate value node used for numeric nodes.
 */
public abstract class NumericNode
    extends ValueNode
{
    protected NumericNode() { }

    @Override
    public final JsonNodeType getNodeType()
    {
        return JsonNodeType.NUMBER;
    }

    // // // Let's re-abstract so sub-classes handle them

    @Override
    public abstract JsonParser.NumberType numberType();

    @Override public abstract Number numberValue();
    @Override public abstract int intValue();
    @Override public abstract long longValue();
    @Override public abstract double doubleValue();
    @Override public abstract BigDecimal org.testifyproject.testifyprojectcimalValue();
    @Override public abstract BigInteger bigIntegerValue();

    @Override public abstract boolean canConvertToInt();
    @Override public abstract boolean canConvertToLong();
    
    /* 
    /**********************************************************
    /* General type coercions
    /**********************************************************
     */
    
    @Override
    public abstract String asText();

    @Override
    public final int asInt() {
        return intValue();
    }
    @Override
    public final int asInt(int org.testifyproject.testifyprojectfaultValue) {
        return intValue();
    }

    @Override
    public final long asLong() {
        return longValue();
    }
    @Override
    public final long asLong(long org.testifyproject.testifyprojectfaultValue) {
        return longValue();
    }
    
    @Override
    public final double asDouble() {
        return doubleValue();
    }
    @Override
    public final double asDouble(double org.testifyproject.testifyprojectfaultValue) {
        return doubleValue();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy