public class JobDeadline extends Object
Constructor and Description |
---|
JobDeadline(Date absoluteDeadline) |
JobDeadline(Duration relativeDeadline) |
Modifier and Type | Method and Description |
---|---|
static Date |
applyFormats(String expression,
DateFormat... dateFormats) |
Date |
getAbsoluteDeadline() |
Duration |
getRelativeDeadline() |
boolean |
isAbsolute() |
boolean |
isRelative() |
static Optional<Duration> |
parseDuration(String stringAsDuration)
Parse string to the duration:
`05:44:15` - 5 hours, 44 minutes, 15 seconds
`44:15` - 44 minutes, 15 seconds
`15` - 15 seconds
|
public JobDeadline(Date absoluteDeadline)
public JobDeadline(Duration relativeDeadline)
public Date getAbsoluteDeadline()
public Duration getRelativeDeadline()
public boolean isAbsolute()
public boolean isRelative()
public static Optional<Duration> parseDuration(String stringAsDuration) throws Exception
Exception
- if it is not possible to parse the stringpublic static Date applyFormats(String expression, DateFormat... dateFormats) throws ParseException
ParseException