Examples of JsonTypeMismatchException


Examples of com.github.jsonj.exceptions.JsonTypeMismatchException

    @Override
    public float asFloat() {
        if(type == JsonType.number) {
            return ((Number)value).floatValue();
        } else {
            throw new JsonTypeMismatchException("not a number '"+value+"'");
        }
    }
View Full Code Here

Examples of com.github.jsonj.exceptions.JsonTypeMismatchException

    @Override
    public double asDouble() {
        if(type == JsonType.number) {
            return ((Number)value).doubleValue();
        } else {
            throw new JsonTypeMismatchException("not a number '"+value+"'");
        }
    }
View Full Code Here

Examples of com.github.jsonj.exceptions.JsonTypeMismatchException

    @Override
    public boolean asBoolean() {
        if(type == JsonType.bool) {
            return ((Boolean)value).booleanValue();
        } else{
            throw new JsonTypeMismatchException("not a boolean '"+value+"'");
        }
    }
View Full Code Here

Examples of com.github.jsonj.exceptions.JsonTypeMismatchException

    public JsonType type() {
        return type;
    }
    @Override
    public JsonObject asObject() {
        throw new JsonTypeMismatchException("not an object");
    }
View Full Code Here

Examples of com.github.jsonj.exceptions.JsonTypeMismatchException

        throw new JsonTypeMismatchException("not an object");
    }

    @Override
    public JsonArray asArray() {
        throw new JsonTypeMismatchException("not an array");
    }
View Full Code Here

Examples of com.github.jsonj.exceptions.JsonTypeMismatchException

        throw new JsonTypeMismatchException("not an array");
    }

    @Override
    public JsonSet asSet() {
        throw new JsonTypeMismatchException("not an array");
    }
View Full Code Here

Examples of com.github.jsonj.exceptions.JsonTypeMismatchException

        return this;
    }

    @Override
    public JsonArray asArray() {
        throw new JsonTypeMismatchException("not an array");
    }
View Full Code Here

Examples of com.github.jsonj.exceptions.JsonTypeMismatchException

        throw new JsonTypeMismatchException("not an array");
    }

    @Override
    public JsonSet asSet() {
        throw new JsonTypeMismatchException("not an array");
    }
View Full Code Here

Examples of com.github.jsonj.exceptions.JsonTypeMismatchException

        throw new JsonTypeMismatchException("not an array");
    }

    @Override
    public JsonPrimitive asPrimitive() {
        throw new JsonTypeMismatchException("not a primitive");
    }
View Full Code Here

Examples of com.github.jsonj.exceptions.JsonTypeMismatchException

        throw new JsonTypeMismatchException("not a primitive");
    }

    @Override
    public float asFloat() {
        throw new JsonTypeMismatchException("not a primitive");
    }
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.