public class Duration extends Object
Constructor and 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 and 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 © 2020. All rights reserved.