public final class Duration extends Object implements Comparable<Duration>
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Duration other) |
boolean |
equals(Object obj) |
int |
getNano() |
long |
getSeconds() |
int |
hashCode() |
Duration |
minus(Duration other) |
static Duration |
ofDays(long days) |
static Duration |
ofHours(long hours) |
static Duration |
ofMillis(long millis) |
static Duration |
ofMinutes(long minutes) |
static Duration |
ofSeconds(long seconds) |
static Duration |
ofSeconds(long seconds,
long nanoAdjustment) |
Duration |
plus(Duration other) |
long |
toMillis() |
String |
toString() |
public static Duration ofDays(long days)
public static Duration ofHours(long hours)
public static Duration ofMinutes(long minutes)
public static Duration ofSeconds(long seconds)
public static Duration ofSeconds(long seconds, long nanoAdjustment)
public static Duration ofMillis(long millis)
public long getSeconds()
public int getNano()
public long toMillis()
public int compareTo(Duration other)
compareTo in interface Comparable<Duration>Copyright © 2026. All rights reserved.