String from = interval.get("from").asText();
String to = interval.get("to").asText();
return new RelativeInterval<TimeUnit>(unit, (int) Float.parseFloat(from), (int) Float.parseFloat(to));
} else if ("absolute".equals(type)) {
// an absolute interval
return new AbsoluteInterval<TimeUnit>(unit, unit.parseAbsolute(interval.get("from")),
unit.parseAbsolute(interval.get("to")));
}
}
} catch (InvalidIntervalException e) {
// ignore the interval