Class CalendarDuration
java.lang.Object
io.jmix.fullcalendarflowui.kit.component.model.CalendarDuration
- All Implemented Interfaces:
Serializable
A time based object. Is used to pass time value, e.g. to properties
(
JmixFullCalendar.setSlotDuration(CalendarDuration)
or to navigation methods
(JmixFullCalendar.navigateToNext(CalendarDuration)
).
Note that each property in this object does not include the units of the other properties.
For instance, if the duration is 6
months, the year value will be 0
, not 0.5
.
And vice-versa, if the duration is 1
year, the month value will be 0
, not 12
.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
getDays()
int
getHours()
long
int
int
long
int
getWeeks()
int
getYears()
int
hashCode()
minusDays
(int days) Returns a copy of thisCalendarDuration
with the specified number of days subtracted.minusHours
(int hours) Returns a copy of thisCalendarDuration
with the specified number of hours subtracted.minusMilliseconds
(long milliseconds) Returns a copy of thisCalendarDuration
with the specified number of milliseconds subtracted.minusMinutes
(int minutes) Returns a copy of thisCalendarDuration
with the specified number of minutes subtracted.minusMonths
(int months) Returns a copy of thisCalendarDuration
with the specified number of months subtracted.minusSeconds
(long seconds) Returns a copy of thisCalendarDuration
with the specified number of seconds subtracted.minusWeeks
(int weeks) Returns a copy of thisCalendarDuration
with the specified number of weeks subtracted.minusYears
(int years) Returns a copy of thisCalendarDuration
with the specified number of years subtracted.static CalendarDuration
ofDays
(int days) Creates a duration object from days.static CalendarDuration
ofDuration
(Duration duration) Creates a new duration object from the providedDuration
.static CalendarDuration
ofHours
(int hours) Creates a duration object from hours.static CalendarDuration
ofMilliseconds
(long ms) Creates a duration object from milliseconds.static CalendarDuration
ofMinutes
(int minutes) Creates a duration object from minutes.static CalendarDuration
ofMonths
(int months) Creates a duration object from months.static CalendarDuration
ofSeconds
(long seconds) Creates a duration object from seconds.static CalendarDuration
ofWeeks
(int weeks) Creates a duration object from weeks.static CalendarDuration
ofYears
(int years) Creates a duration object from years.plusDays
(int days) Returns a copy of thisCalendarDuration
with the specified number of days added.plusHours
(int hours) Returns a copy of thisCalendarDuration
with the specified number of hours added.plusMilliseconds
(long milliseconds) Returns a copy of thisCalendarDuration
with the specified number of milliseconds added.plusMinutes
(int minutes) Returns a copy of thisCalendarDuration
with the specified number of minutes added.plusMonths
(int months) Returns a copy of thisCalendarDuration
with the specified number of months added.plusSeconds
(long seconds) Returns a copy of thisCalendarDuration
with the specified number of seconds added.plusWeeks
(int weeks) Returns a copy of thisCalendarDuration
with the specified number of weeks added.plusYears
(int years) Returns a copy of thisCalendarDuration
with the specified number of years added.
-
Field Details
-
years
protected int years -
months
protected int months -
weeks
protected int weeks -
days
protected int days -
hours
protected int hours -
minutes
protected int minutes -
seconds
protected long seconds -
milliseconds
protected long milliseconds
-
-
Method Details
-
ofYears
Creates a duration object from years.- Parameters:
years
- years to pass- Returns:
- new duration object
-
ofMonths
Creates a duration object from months.- Parameters:
months
- months to pass- Returns:
- new duration object
-
ofWeeks
Creates a duration object from weeks.- Parameters:
weeks
- weeks to pass- Returns:
- new duration object
-
ofDays
Creates a duration object from days.- Parameters:
days
- days to pass- Returns:
- new duration object
-
ofHours
Creates a duration object from hours.- Parameters:
hours
- hours to pass- Returns:
- new duration object
-
ofMinutes
Creates a duration object from minutes.- Parameters:
minutes
- minutes to pass- Returns:
- new duration object
-
ofSeconds
Creates a duration object from seconds.- Parameters:
seconds
- seconds to pass- Returns:
- new duration object
-
ofMilliseconds
Creates a duration object from milliseconds.- Parameters:
ms
- milliseconds to pass- Returns:
- new duration object
-
ofDuration
Creates a new duration object from the providedDuration
. The new object will contain the extracted days, along with the remaining hours, seconds, and milliseconds after the calculation.- Parameters:
duration
- duration to pass- Returns:
- new duration object
-
plusYears
Returns a copy of thisCalendarDuration
with the specified number of years added.- Parameters:
years
- years to add- Returns:
- a
CalendarDuration
based on this duration with the years added
-
minusYears
Returns a copy of thisCalendarDuration
with the specified number of years subtracted.- Parameters:
years
- years to subtract- Returns:
- a
CalendarDuration
based on this duration with the years subtracted
-
plusMonths
Returns a copy of thisCalendarDuration
with the specified number of months added.- Parameters:
months
- months to add- Returns:
- a
CalendarDuration
based on this duration with the months added
-
minusMonths
Returns a copy of thisCalendarDuration
with the specified number of months subtracted.- Parameters:
months
- months to subtract- Returns:
- a
CalendarDuration
based on this duration with the months subtracted
-
plusWeeks
Returns a copy of thisCalendarDuration
with the specified number of weeks added.- Parameters:
weeks
- weeks to add- Returns:
- a
CalendarDuration
based on this duration with the weeks added
-
minusWeeks
Returns a copy of thisCalendarDuration
with the specified number of weeks subtracted.- Parameters:
weeks
- weeks to subtract- Returns:
- a
CalendarDuration
based on this duration with the weeks subtracted
-
plusDays
Returns a copy of thisCalendarDuration
with the specified number of days added.- Parameters:
days
- days to add- Returns:
- a
CalendarDuration
based on this duration with the days added
-
minusDays
Returns a copy of thisCalendarDuration
with the specified number of days subtracted.- Parameters:
days
- days to subtract- Returns:
- a
CalendarDuration
based on this duration with the days subtracted
-
plusHours
Returns a copy of thisCalendarDuration
with the specified number of hours added.- Parameters:
hours
- hours to add- Returns:
- a
CalendarDuration
based on this duration with the hours added
-
minusHours
Returns a copy of thisCalendarDuration
with the specified number of hours subtracted.- Parameters:
hours
- hours to subtract- Returns:
- a
CalendarDuration
based on this duration with the hours subtracted
-
plusMinutes
Returns a copy of thisCalendarDuration
with the specified number of minutes added.- Parameters:
minutes
- minutes to add- Returns:
- a
CalendarDuration
based on this duration with the minutes added
-
minusMinutes
Returns a copy of thisCalendarDuration
with the specified number of minutes subtracted.- Parameters:
minutes
- minutes to subtract- Returns:
- a
CalendarDuration
based on this duration with the minutes subtracted
-
plusSeconds
Returns a copy of thisCalendarDuration
with the specified number of seconds added.- Parameters:
seconds
- seconds to add- Returns:
- a
CalendarDuration
based on this duration with the seconds added
-
minusSeconds
Returns a copy of thisCalendarDuration
with the specified number of seconds subtracted.- Parameters:
seconds
- seconds to subtract- Returns:
- a
CalendarDuration
based on this duration with the seconds subtracted
-
plusMilliseconds
Returns a copy of thisCalendarDuration
with the specified number of milliseconds added.- Parameters:
milliseconds
- milliseconds to add- Returns:
- a
CalendarDuration
based on this duration with the milliseconds added
-
minusMilliseconds
Returns a copy of thisCalendarDuration
with the specified number of milliseconds subtracted.- Parameters:
milliseconds
- milliseconds to subtract- Returns:
- a
CalendarDuration
based on this duration with the milliseconds subtracted
-
getYears
public int getYears()- Returns:
- years field
-
getMonths
public int getMonths()- Returns:
- months field
-
getWeeks
public int getWeeks()- Returns:
- weeks field
-
getDays
public int getDays()- Returns:
- days field
-
getHours
public int getHours()- Returns:
- hours field
-
getMinutes
public int getMinutes()- Returns:
- minutes field
-
getSeconds
public long getSeconds()- Returns:
- seconds field
-
getMilliseconds
public long getMilliseconds()- Returns:
- milliseconds field
-
equals
-
hashCode
public int hashCode()
-