public PrimitiveValue constVal()
    {
        if (presence() != CONSTANT)
        {
            throw new IllegalStateException("type is not of constant presence");
        }

        return constValue;
    }
The constant value of the type if specified.

@return value of the constant for this type.
sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/EncodedDataType.java