Build an expiry from the provided value.
If the value is null or unparseable then Optional.empty()
is returned otherwise the behaviour is :
- If the value is numeric and less than
System.currentTimeMillis()
then it is treated as relative to now()
;
expiry is in milliseconds
- If the value is numberic and greater than
System.currentTimeMillis()
then it is treated as absolute; expiry is in
milliseconds
- If the value is a recognised value from
DateFormatUtil.parse(String)
then it is treated as absolute
- If it can't be resolved by any of those means, then it is ignored (i.e. treated as though there is no expiry).