code: public static Object decode(Object value, Type type) {
          if (value instanceof Integer) {
              int i = (Integer) value;
              switch (type.getTag()) {
              case BOOLEAN:  return i != 0;
              case CHAR:     return (char) i;
              case BYTE:     return (byte) i;
              case SHORT:    return (short) i;
              }
          }
          return value;
      }
docs: Converts a constant in internal representation (in which
  boolean, char, byte, short, and int are each represented by an
  Integer) into standard representation.  Other values (including
  null) are returned unchanged.