docs: public static int asInteger(Object value) {
          if (value instanceof Number) {
              return ((Number) value).intValue();
          } else if (value instanceof Numeric) {
              return ((Numeric) value).asInteger();
          } else if (value instanceof Boolean) {
              return ((Boolean) value) ? 1 : 0;
          } else if (value instanceof CharSequence) {
              try {
                  return Integer.parseInt(value.toString());
              } catch (NumberFormatException nfe) {
                  throw new IncompatibleValueException(
                          "Unable to parse string \"" + Strings.escape(value.toString()) +
                          "\" to an int", nfe);
              }
          } else if (value instanceof Date) {
              // Convert date timestamp to seconds since epoch.
              return (int) (((Date) value).getTime() / 1000);
          }
          throw new IncompatibleValueException("Unable to convert " + value.getClass().getSimpleName() + " to an int");
      }