docs: public void encodeSelf(ObjectOutput buf) throws IOException {
      buf.writeByte((byte) type);
      switch (type) {
      case STRING:
        buf.writeUTF((String) value);
        return;
      case LONG:
        buf.writeLong(((Long) value).longValue()); // was NumericValue
        return;
      case DOUBLE:
        buf.writeDouble(((Double) value).doubleValue()); // was NumericValue
        return;
      case INT:
        buf.writeInt(((Integer) value).intValue()); // was NumericValue
        return;
      case FLOAT:
        buf.writeFloat(((Float) value).floatValue()); // was NumericValue
        return;
      case BOOLEAN:
        buf.writeBoolean(((Boolean) value).booleanValue()); // was BooleanValue
        return;
      case OBJECT:
        buf.writeObject(value);
      default:
        throw new IllegalStateException();
      }
    }