public final class Seconds extends Object implements Serializable
There is Duration
type in JDK only and because it's quite often need to define parameter values in seconds,
this class is quite useful.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
int |
getSeconds()
Gets count of seconds.
|
int |
hashCode() |
static Seconds |
of(int seconds)
Creates seconds with specified count.
|
static Seconds |
of(String seconds)
Creates seconds with specified count.
|
Duration |
toDuration()
Converts to
Duration in seconds. |
String |
toString() |
public static final Seconds ZERO
public static Seconds of(int seconds)
seconds
- Count of secondspublic static Seconds of(String seconds)
seconds
- Count of secondsIllegalArgumentException
- if input string cannot be converted to the numberpublic int getSeconds()
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.