public class Duration
extends java.lang.Object
Constructor and Description |
---|
Duration(int seconds)
Create a Duration instance from a number of seconds.
|
Duration(java.lang.String durationString)
Create a Duration instance from a human readable string.
|
Modifier and Type | Method and Description |
---|---|
static Duration |
forValue(java.lang.String value) |
int |
getSeconds()
Get the number of seconds this duration represents.
|
void |
setSeconds(int seconds)
Set the number of seconds this duration represents.
|
java.lang.String |
toString() |
public Duration(java.lang.String durationString)
durationString
- a duration in human readable formatpublic Duration(int seconds)
seconds
- the number of seconds for this Duration instance to representpublic int getSeconds()
public void setSeconds(int seconds)
seconds
- the number of seconds this duration representspublic java.lang.String toString()
toString
in class java.lang.Object
public static Duration forValue(java.lang.String value)