msgpack-java icon indicating copy to clipboard operation
msgpack-java copied to clipboard

ImmutableDoubleValueImpl needs as* methods

Open jandk opened this issue 10 years ago • 0 comments

When trying to extract floating point numbers from values, I get an MessageTypeCastException.

This because the ImmutableDoubleValueImpl as no as* methods, which makes it hard to get the values out.

switch (value.getValueType())
{
    case FLOAT:
        return value.asNumberValue().toFloat();
    default: throw new Exception();
}

jandk avatar Nov 17 '15 15:11 jandk