Class DurationTypeHandler
java.lang.Object
ch.tocco.nice2.types.spi.TypeHandlerWrapper<Long>
ch.tocco.nice2.types.impl.handlers.DurationTypeHandler
- All Implemented Interfaces:
 TypeHandler<Long>
String syntax: Either just an amount of millis or:
 TODO Change syntax to require hours:minutes:seconds in input, and always output at least these parts.
      Only the leftmost input value (hours) may overflow, eg 48:30:59 but not 8:61:00 in asObject().
      Atm a value like "8:30" is mm:ss which is misleading depending on context. This change is for
      disambiguation, and is in compliance with the types.DurationUtil.
      Also, the input must allow negative values (minus sign in front of the whole string).
 
 [[<days>d]<hours>:]<minutes>:<seconds>[.<millis>]
 - 
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final PatternGroups: 3: days (optional) 6: hours (optional) 7: minutes 8: seconds 10: millis (optional) OR 11: millisstatic final longstatic final longstatic final longFields inherited from class ch.tocco.nice2.types.spi.TypeHandlerWrapper
baseHandler, type - 
Constructor Summary
Constructors - 
Method Summary
Methods inherited from class ch.tocco.nice2.types.spi.TypeHandlerWrapper
compare, contains, getEmptyValue, init, invalid, invalid, isBoolean, isChronological, isEqual, isNumeric, isolate, matchesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ch.tocco.nice2.types.spi.TypeHandler
getGenerationType 
- 
Field Details
- 
DURATION_RE
Groups:- 3: days (optional)
 - 6: hours (optional)
 - 7: minutes
 - 8: seconds
 - 10: millis (optional)
 
- 11: millis
 
 - 
SECOND
public static final long SECOND- See Also:
 
 - 
MINUTE
public static final long MINUTE- See Also:
 
 - 
HOUR
public static final long HOUR- See Also:
 
 - 
DAY
public static final long DAY- See Also:
 
 
 - 
 - 
Constructor Details
- 
DurationTypeHandler
public DurationTypeHandler() 
 - 
 - 
Method Details
- 
shouldBeUnique
public boolean shouldBeUnique()- Specified by:
 shouldBeUniquein interfaceTypeHandler<Long>- Overrides:
 shouldBeUniquein classTypeHandlerWrapper<Long>- See Also:
 
 - 
asObject
- Specified by:
 asObjectin interfaceTypeHandler<Long>- Overrides:
 asObjectin classTypeHandlerWrapper<Long>- Throws:
 StringConversionException
 - 
asString
- Specified by:
 asStringin interfaceTypeHandler<Long>- Overrides:
 asStringin classTypeHandlerWrapper<Long>
 - 
validate
public boolean validate(@Nullable @Nullable Long value, boolean exception) throws ValidationException - Specified by:
 validatein interfaceTypeHandler<Long>- Overrides:
 validatein classTypeHandlerWrapper<Long>- Throws:
 ValidationException- See Also:
 
 
 -