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

org.pkl.thirdparty.msgpack.value.impl.AbstractImmutableValue Maven / Gradle / Ivy

Go to download

Fat Jar containing pkl-cli, pkl-codegen-java, pkl-codegen-kotlin, pkl-config-java, pkl-core, pkl-doc, and their shaded third-party dependencies.

There is a newer version: 0.27.1
Show newest version
//
// MessagePack for Java
//
//    Licensed under the Apache License, Version 2.0 (the "License");
//    you may not use this file except in compliance with the License.
//    You may obtain a copy of the License at
//
//        http://www.apache.org/licenses/LICENSE-2.0
//
//    Unless required by applicable law or agreed to in writing, software
//    distributed under the License is distributed on an "AS IS" BASIS,
//    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//    See the License for the specific language governing permissions and
//    limitations under the License.
//
package org.pkl.thirdparty.msgpack.value.impl;

import org.pkl.thirdparty.msgpack.core.MessageTypeCastException;
import org.pkl.thirdparty.msgpack.value.ImmutableArrayValue;
import org.pkl.thirdparty.msgpack.value.ImmutableBinaryValue;
import org.pkl.thirdparty.msgpack.value.ImmutableBooleanValue;
import org.pkl.thirdparty.msgpack.value.ImmutableExtensionValue;
import org.pkl.thirdparty.msgpack.value.ImmutableFloatValue;
import org.pkl.thirdparty.msgpack.value.ImmutableIntegerValue;
import org.pkl.thirdparty.msgpack.value.ImmutableMapValue;
import org.pkl.thirdparty.msgpack.value.ImmutableNilValue;
import org.pkl.thirdparty.msgpack.value.ImmutableNumberValue;
import org.pkl.thirdparty.msgpack.value.ImmutableRawValue;
import org.pkl.thirdparty.msgpack.value.ImmutableStringValue;
import org.pkl.thirdparty.msgpack.value.ImmutableTimestampValue;
import org.pkl.thirdparty.msgpack.value.ImmutableValue;

abstract class AbstractImmutableValue
        implements ImmutableValue
{
    @Override
    public boolean isNilValue()
    {
        return getValueType().isNilType();
    }

    @Override
    public boolean isBooleanValue()
    {
        return getValueType().isBooleanType();
    }

    @Override
    public boolean isNumberValue()
    {
        return getValueType().isNumberType();
    }

    @Override
    public boolean isIntegerValue()
    {
        return getValueType().isIntegerType();
    }

    @Override
    public boolean isFloatValue()
    {
        return getValueType().isFloatType();
    }

    @Override
    public boolean isRawValue()
    {
        return getValueType().isRawType();
    }

    @Override
    public boolean isBinaryValue()
    {
        return getValueType().isBinaryType();
    }

    @Override
    public boolean isStringValue()
    {
        return getValueType().isStringType();
    }

    @Override
    public boolean isArrayValue()
    {
        return getValueType().isArrayType();
    }

    @Override
    public boolean isMapValue()
    {
        return getValueType().isMapType();
    }

    @Override
    public boolean isExtensionValue()
    {
        return getValueType().isExtensionType();
    }

    @Override
    public boolean isTimestampValue()
    {
        return false;
    }

    @Override
    public ImmutableNilValue asNilValue()
    {
        throw new MessageTypeCastException();
    }

    @Override
    public ImmutableBooleanValue asBooleanValue()
    {
        throw new MessageTypeCastException();
    }

    @Override
    public ImmutableNumberValue asNumberValue()
    {
        throw new MessageTypeCastException();
    }

    @Override
    public ImmutableIntegerValue asIntegerValue()
    {
        throw new MessageTypeCastException();
    }

    @Override
    public ImmutableFloatValue asFloatValue()
    {
        throw new MessageTypeCastException();
    }

    @Override
    public ImmutableRawValue asRawValue()
    {
        throw new MessageTypeCastException();
    }

    @Override
    public ImmutableBinaryValue asBinaryValue()
    {
        throw new MessageTypeCastException();
    }

    @Override
    public ImmutableStringValue asStringValue()
    {
        throw new MessageTypeCastException();
    }

    @Override
    public ImmutableArrayValue asArrayValue()
    {
        throw new MessageTypeCastException();
    }

    @Override
    public ImmutableMapValue asMapValue()
    {
        throw new MessageTypeCastException();
    }

    @Override
    public ImmutableExtensionValue asExtensionValue()
    {
        throw new MessageTypeCastException();
    }

    @Override
    public ImmutableTimestampValue asTimestampValue()
    {
        throw new MessageTypeCastException();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy