示例#1
0
  private Long parseLong(String value) throws IllegalArgumentException {
    if (value == null || value.trim().length() == 0) {
      return null;
    }

    try {
      return Long.parseLong(value);
    } catch (NumberFormatException e) {
      throw new IllegalArgumentException("Invalid long value '" + value + "' specified");
    }
  }
示例#2
0
  private Date parseDate(String value) throws IllegalArgumentException {
    if (value == null || value.trim().length() == 0) {
      return null;
    }

    try {
      return getDateFormat().parse(value);
    } catch (ParseException e) {
    }

    try {
      return new Date(Long.parseLong(value));
    } catch (NumberFormatException e) {
    }

    throw new IllegalArgumentException("Invalid date value '" + value + "' specified");
  }
 public void setTimeToWait(int timeToWait) {
   this.timeToWait = timeToWait;
   project.setProperty("timeToWait", Long.toString(timeToWait));
 }