code: static void checkConstant(final Object cst) {
          if (!(cst instanceof Integer) && !(cst instanceof Float)
                  && !(cst instanceof Long) && !(cst instanceof Double)
                  && !(cst instanceof String)) {
              throw new IllegalArgumentException("Invalid constant: " + cst);
          }
      }
docs: Checks that the given value is an {@link Integer}, a{@link Float}, a
  {@link Long}, a {@link Double} or a {@link String}.
  
  @param cst
  the value to be checked.