Package io.vertx.pgclient.data
Class Interval
- java.lang.Object
-
- io.vertx.pgclient.data.Interval
-
public class Interval extends Object
Postgres Interval is date and time based such as 120 years 3 months 332 days 20 hours 20 minutes 20.999999 seconds- Author:
- Emad Alblueshi
-
-
Constructor Summary
Constructors Constructor 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)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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(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)
static Interval
of(java.time.Duration duration)
Creates an instance from the givenDuration
.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 ofDuration
.String
toString()
Interval
years(int years)
-
-
-
Constructor Detail
-
Interval
public Interval()
-
Interval
public Interval(int years, int months, int days, int hours, int minutes, int seconds, int microseconds)
-
Interval
public Interval(int years, int months, int days, int hours, int minutes, int seconds)
-
Interval
public Interval(int years, int months, int days, int hours, int minutes)
-
Interval
public Interval(int years, int months, int days, int hours)
-
Interval
public Interval(int years, int months, int days)
-
Interval
public Interval(int years, int months)
-
Interval
public Interval(int years)
-
-
Method Detail
-
of
public static Interval of()
-
of
public static Interval of(int years, int months, int days, int hours, int minutes, int seconds, int microseconds)
-
of
public static Interval of(int years, int months, int days, int hours, int minutes, int seconds)
-
of
public static Interval of(int years, int months, int days, int hours, int minutes)
-
of
public static Interval of(int years, int months, int days, int hours)
-
of
public static Interval of(int years, int months, int days)
-
of
public static Interval of(int years, int months)
-
of
public static Interval of(int years)
-
of
public static Interval of(java.time.Duration duration)
Creates an instance from the givenDuration
.The conversion algorithm assumes a year lasts 12 months and a month lasts 30 days, as Postgres does and ISO 8601 suggests.
- Parameters:
duration
- the value to convert- Returns:
- a new instance of
Interval
-
years
public Interval years(int years)
-
months
public Interval months(int months)
-
days
public Interval days(int days)
-
hours
public Interval hours(int hours)
-
minutes
public Interval minutes(int minutes)
-
seconds
public Interval seconds(int seconds)
-
microseconds
public Interval microseconds(int microseconds)
-
getYears
public int getYears()
-
setYears
public void setYears(int years)
-
getMonths
public int getMonths()
-
setMonths
public void setMonths(int months)
-
getDays
public int getDays()
-
setDays
public void setDays(int days)
-
getHours
public int getHours()
-
setHours
public void setHours(int hours)
-
getMinutes
public int getMinutes()
-
setMinutes
public void setMinutes(int minutes)
-
getSeconds
public int getSeconds()
-
setSeconds
public void setSeconds(int seconds)
-
getMicroseconds
public int getMicroseconds()
-
setMicroseconds
public void setMicroseconds(int microseconds)
-
toDuration
public java.time.Duration toDuration()
Convert this interval to an instance ofDuration
.The conversion algorithm assumes a year lasts 12 months and a month lasts 30 days, as Postgres does and ISO 8601 suggests.
- Returns:
- an instance of
Duration
representing the same amount of time as this interval
-
-