public class Interval extends Object
Constructor and Description |
---|
Interval() |
Interval(int years) |
Interval(int years,
int months) |
Interval(int years,
int months,
int days) |
Interval(int years,
int months,
int days,
int hours) |
Interval(int years,
int months,
int days,
int hours,
int minutes) |
Interval(int years,
int months,
int days,
int hours,
int minutes,
int seconds) |
Interval(int years,
int months,
int days,
int hours,
int minutes,
int seconds,
int microseconds) |
Modifier and Type | Method and Description |
---|---|
Interval |
days(int days) |
boolean |
equals(Object o) |
int |
getDays() |
int |
getHours() |
int |
getMicroseconds() |
int |
getMinutes() |
int |
getMonths() |
int |
getSeconds() |
int |
getYears() |
int |
hashCode() |
Interval |
hours(int hours) |
Interval |
microseconds(int microseconds) |
Interval |
minutes(int minutes) |
Interval |
months(int months) |
static Interval |
of() |
static Interval |
of(java.time.Duration duration)
Creates an instance from the given
Duration . |
static Interval |
of(int years) |
static Interval |
of(int years,
int months) |
static Interval |
of(int years,
int months,
int days) |
static Interval |
of(int years,
int months,
int days,
int hours) |
static Interval |
of(int years,
int months,
int days,
int hours,
int minutes) |
static Interval |
of(int years,
int months,
int days,
int hours,
int minutes,
int seconds) |
static Interval |
of(int years,
int months,
int days,
int hours,
int minutes,
int seconds,
int microseconds) |
Interval |
seconds(int seconds) |
void |
setDays(int days) |
void |
setHours(int hours) |
void |
setMicroseconds(int microseconds) |
void |
setMinutes(int minutes) |
void |
setMonths(int months) |
void |
setSeconds(int seconds) |
void |
setYears(int years) |
java.time.Duration |
toDuration()
Convert this interval to an instance of
Duration . |
String |
toString() |
Interval |
years(int years) |
public Interval()
public Interval(int years, int months, int days, int hours, int minutes, int seconds, int microseconds)
public Interval(int years, int months, int days, int hours, int minutes, int seconds)
public Interval(int years, int months, int days, int hours, int minutes)
public Interval(int years, int months, int days, int hours)
public Interval(int years, int months, int days)
public Interval(int years, int months)
public Interval(int years)
public static Interval of()
public static Interval of(int years, int months, int days, int hours, int minutes, int seconds, int microseconds)
public static Interval of(int years, int months, int days, int hours, int minutes, int seconds)
public static Interval of(int years, int months, int days, int hours, int minutes)
public static Interval of(int years, int months, int days, int hours)
public static Interval of(int years, int months, int days)
public static Interval of(int years, int months)
public static Interval of(int years)
public static Interval of(java.time.Duration duration)
Duration
.
The conversion algorithm assumes a year lasts 12 months and a month lasts 30 days, as Postgres does and ISO 8601 suggests.
duration
- the value to convertInterval
public Interval years(int years)
public Interval months(int months)
public Interval days(int days)
public Interval hours(int hours)
public Interval minutes(int minutes)
public Interval seconds(int seconds)
public Interval microseconds(int microseconds)
public int getYears()
public void setYears(int years)
public int getMonths()
public void setMonths(int months)
public int getDays()
public void setDays(int days)
public int getHours()
public void setHours(int hours)
public int getMinutes()
public void setMinutes(int minutes)
public int getSeconds()
public void setSeconds(int seconds)
public int getMicroseconds()
public void setMicroseconds(int microseconds)
public java.time.Duration toDuration()
Duration
.
The conversion algorithm assumes a year lasts 12 months and a month lasts 30 days, as Postgres does and ISO 8601 suggests.
Duration
representing the same amount of time as this intervalCopyright © 2024 Eclipse. All rights reserved.