public class TimeValue extends Object implements Comparable<TimeValue>
Constructor and Description |
---|
TimeValue(int hour,
int minutes)
Constructor.
|
TimeValue(int hour,
int minutes,
int seconds)
Constructor.
|
TimeValue(int hour,
int minutes,
int seconds,
int nanoSeconds)
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(Time time)
Makes an instance of time value from a
Time . |
int |
getHour()
Returns the hour.
|
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.
|
static TimeValue |
of(int hour,
int minutes)
Makes an instance of time value from a hour and minutes.
|
static TimeValue |
of(int hour,
int minutes,
int seconds)
Makes an instance of time value from a hour, minutes and seconds.
|
static TimeValue |
of(int hour,
int minutes,
int seconds,
int nanoSeconds)
Makes an instance of time value from a hour, 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. |
String |
toString() |
public TimeValue(int hour, int minutes, int seconds, int nanoSeconds)
hour
- Hour.minutes
- Minutes.seconds
- Seconds.nanoSeconds
- Nanoseconds.public TimeValue(int hour, int minutes, int seconds)
hour
- Hour.minutes
- Minutes.seconds
- Seconds.public TimeValue(int hour, int minutes)
hour
- Hour.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 static TimeValue of(int hour, int minutes, int seconds, int nanoSeconds)
hour
- Hour.minutes
- Minutes.seconds
- Seconds.nanoSeconds
- Nanoseconds.public static TimeValue of(int hour, int minutes, int seconds)
hour
- Hour.minutes
- Minutes.seconds
- Seconds.public static TimeValue of(int hour, int minutes)
hour
- Hour.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 int getHour()
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.Copyright © 2015 AssertJ. All Rights Reserved.