Annotation Interface DurationFormat
@Documented
@Retention(RUNTIME)
@Target({METHOD,FIELD,PARAMETER,ANNOTATION_TYPE})
public @interface DurationFormat
Declares that a field or method parameter should be formatted as a
Duration, according to the specified style.- Since:
- 6.2
- Author:
- Simon Baslé
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDuration format styles.static enumDuration format unit, which mirrors a subset ofChronoUnitand allows conversion to and from supportedChronoUnitas well as converting durations to longs. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionDefine whichDurationFormat.Unitto fall back to in case thestyle()needs a unit for either parsing or printing, and none is explicitly provided in the input (Unit.MILLISif unspecified).WhichStyleto use for parsing and printing aDuration.
-
Element Details
-
style
DurationFormat.Style styleWhichStyleto use for parsing and printing aDuration. Defaults to the JDK style (DurationFormat.Style.ISO8601).- Default:
- ISO8601
-
defaultUnit
DurationFormat.Unit defaultUnitDefine whichDurationFormat.Unitto fall back to in case thestyle()needs a unit for either parsing or printing, and none is explicitly provided in the input (Unit.MILLISif unspecified).- Default:
- MILLIS
-