Package org.msgpack.core

Examples of org.msgpack.core.MessageTypeException


    protected <E extends Value> E as(Class<E> valueClass, ValueType vt) {
        return as(valueClass, 1 << vt.ordinal());
    }
    protected <E extends Value> E as(Class<E> valueClass, int bitMask) {
        if(this.getValueType() == null)
            throw new MessageTypeException("This value points to nothing");
        if(!this.getValueType().isTypeOf(bitMask))
            throw new MessageTypeException(String.format("Expected %s, but %s", valueClass.getSimpleName(), this.getValueType()));
        return valueClass.cast(this);
    }
View Full Code Here


    public MapValue asMapValue() throws MessageTypeException { return as(MapValue.class, ValueType.MAP); }
    public ExtendedValue asExtended() throws MessageTypeException { return as(ExtendedValue.class, ValueType.EXTENDED); }

    @Override
    public ArrayCursor getArrayCursor() throws MessageTypeException {
        throw new MessageTypeException("This value is not an array type");
    }
View Full Code Here

    public ArrayCursor getArrayCursor() throws MessageTypeException {
        throw new MessageTypeException("This value is not an array type");
    }
    @Override
    public MapCursor getMapCursor() throws MessageTypeException {
        throw new MessageTypeException("This value is not a map type");
    }
View Full Code Here

TOP

Related Classes of org.msgpack.core.MessageTypeException

Copyright © 2018 www.massapicom. 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.