public class TimeValue extends Object implements Comparable<TimeValue>
| Constructor and Description |
|---|
TimeValue(Calendar calendar)
Constructor.
|
TimeValue(int hours,
int minutes)
Constructor.
|
TimeValue(int hours,
int minutes,
int seconds)
Constructor.
|
TimeValue(int hours,
int minutes,
int seconds,
int nanoSeconds)
Constructor.
|
TimeValue(LocalTime localTime)
Constructor.
|
TimeValue(String time)
Constructor.
|
TimeValue(Time time)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(TimeValue other) |
boolean |
equals(Object obj) |
static TimeValue |
from(Calendar calendar)
Makes an instance of time value from a
Calendar. |
static TimeValue |
from(LocalTime localTime)
Makes an instance of time value from a
LocalTime. |
static TimeValue |
from(Time time)
Makes an instance of time value from a
Time. |
int |
getHours()
Returns the hours.
|
int |
getMinutes()
Returns the minutes.
|
int |
getNanoSeconds()
Returns the nanoseconds.
|
int |
getSeconds()
Returns the seconds.
|
int |
hashCode() |
boolean |
isAfter(TimeValue time)
Returns if this time value is after the time value in parameter.
|
boolean |
isBefore(TimeValue time)
Returns if this time value is before the time value in parameter.
|
TimeValue |
move(TimeValue time)
Moves the time with the value in parameter.
|
static TimeValue |
now()
Makes an instance of the time value corresponding to now.
|
static TimeValue |
of(int hours,
int minutes)
Makes an instance of time value from a hours and minutes.
|
static TimeValue |
of(int hours,
int minutes,
int seconds)
Makes an instance of time value from a hours, minutes and seconds.
|
static TimeValue |
of(int hours,
int minutes,
int seconds,
int nanoSeconds)
Makes an instance of time value from a hours, minutes, seconds and nanoseconds.
|
static TimeValue |
parse(String time)
Makes an instance of time value from a
String in hh:mm, hh:mm:ss or
hh:mm:ss.nnnnnnnnn format. |
TimeValue |
reverse()
Returns the reverse of the time.
|
String |
toString() |
public TimeValue(int hours,
int minutes,
int seconds,
int nanoSeconds)
hours - Hours.minutes - Minutes.seconds - Seconds.nanoSeconds - Nanoseconds.public TimeValue(int hours,
int minutes,
int seconds)
hours - Hours.minutes - Minutes.seconds - Seconds.public TimeValue(int hours,
int minutes)
hours - Hours.minutes - Minutes.public TimeValue(String time) throws ParseException
time - Time in String format (hh:mm, hh:mm:ss or hh:mm:ss.nnnnnnnnn).NullPointerException - If time is null.ParseException - If time don't respect the hh:mm, hh:mm:ss or
hh:mm:ss.nnnnnnnnn format.public TimeValue(Time time)
time - Time.NullPointerException - If time is null.public TimeValue(Calendar calendar)
calendar - Calendar.NullPointerException - If calendar is null.public TimeValue(LocalTime localTime)
localTime - LocalTime.NullPointerException - If localTime is null.public static TimeValue of(int hours, int minutes, int seconds, int nanoSeconds)
hours - Hours.minutes - Minutes.seconds - Seconds.nanoSeconds - Nanoseconds.public static TimeValue of(int hours, int minutes, int seconds)
hours - Hours.minutes - Minutes.seconds - Seconds.public static TimeValue of(int hours, int minutes)
hours - Hours.minutes - Minutes.public static TimeValue parse(String time) throws ParseException
String in hh:mm, hh:mm:ss or
hh:mm:ss.nnnnnnnnn format.time - Time in String format (hh:mm, hh:mm:ss or hh:mm:ss.nnnnnnnnn).NullPointerException - If time is null.ParseException - If time don't respect the hh:mm, hh:mm:ss or
hh:mm:ss.nnnnnnnnn format.public static TimeValue from(Time time)
Time.time - Time.NullPointerException - If time is null.public static TimeValue from(Calendar calendar)
Calendar.calendar - Calendar.NullPointerException - If calendar is null.public static TimeValue from(LocalTime localTime)
LocalTime.localTime - LocalTime.NullPointerException - If localTime is null.public static TimeValue now()
public int getHours()
public int getMinutes()
public int getSeconds()
public int getNanoSeconds()
public int compareTo(TimeValue other)
compareTo in interface Comparable<TimeValue>public boolean isBefore(TimeValue time)
time - The time value to compare to.public boolean isAfter(TimeValue time)
time - The time value to compare to.public TimeValue move(TimeValue time)
time - Value to move the date.public TimeValue reverse()
Copyright © 2020 AssertJ. All rights reserved.