Package energy.eddie.dataneeds.duration
Class RelativeDuration
java.lang.Object
energy.eddie.dataneeds.duration.DataNeedDuration
energy.eddie.dataneeds.duration.RelativeDuration
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedRelativeDuration(Period start, Period end, CalendarUnit stickyStartCalendarUnit) -
Method Summary
Methods inherited from class energy.eddie.dataneeds.duration.DataNeedDuration
dataNeedId, setDataNeedId
-
Field Details
-
DISCRIMINATOR_VALUE
- See Also:
-
-
Constructor Details
-
RelativeDuration
protected RelativeDuration() -
RelativeDuration
public RelativeDuration(@Nullable Period start, @Nullable Period end, @Nullable CalendarUnit stickyStartCalendarUnit)
-
-
Method Details
-
start
Returns the period that should be used as offset for the start. If empty, assume the earliest date that the region connector supports. -
end
Returns the period that should be used as offset for the end. If empty, assume the latest date that the region connector supports. -
stickyStartCalendarUnit
Indicates the CalendarUnit to which the start of the relative duration should stick to.
E.g., assume today is the 17.04., the relative start is -25 days andstickyStartCalendarUnit()isCalendarUnit.MONTH, then, for a permission request that is created today, the start date should not be 23.03, but it should stick to the start of the CalendarUnit, and therefore be 01.03. Furthermore, for a permission request that is created on the 26.04, the start date should be 01.04 and so forth.
For theCalendarUnit.WEEKit should stick to Mondays.- Returns:
- CalendarUnit to stick to, if empty it should be ignored.
-