public class Duration extends Object
Constructor | Description |
---|---|
Duration(int seconds) |
Create a Duration instance from a number of seconds.
|
Duration(String durationString) |
Create a Duration instance from a human readable string.
|
Modifier and Type | Method | Description |
---|---|---|
static Duration |
forValue(String value) |
|
int |
getSeconds() |
Get the number of seconds this duration represents.
|
void |
setSeconds(int seconds) |
Set the number of seconds this duration represents.
|
String |
toString() |
public Duration(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 representsCopyright © 2018. All rights reserved.