public final class Duration
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DAYS_PER_WEEK |
static int |
MONTHS_PER_YEAR |
static long |
NANOS_PER_HOUR |
static long |
NANOS_PER_MICRO |
static long |
NANOS_PER_MILLI |
static long |
NANOS_PER_MINUTE |
static long |
NANOS_PER_SECOND |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
static Duration |
from(java.lang.String input)
Converts a
String into a duration. |
int |
getDays() |
int |
getMonths() |
long |
getNanoseconds() |
int |
hashCode() |
static Duration |
newInstance(int months,
int days,
long nanoseconds) |
java.lang.String |
toString() |
public static final long NANOS_PER_MICRO
public static final long NANOS_PER_MILLI
public static final long NANOS_PER_SECOND
public static final long NANOS_PER_MINUTE
public static final long NANOS_PER_HOUR
public static final int DAYS_PER_WEEK
public static final int MONTHS_PER_YEAR
public static Duration newInstance(int months, int days, long nanoseconds)
public static Duration from(java.lang.String input)
String
into a duration.
The accepted formats are:
y
: yearsm
: monthsw
: weeksd
: daysh
: hoursm
: minutess
: secondsms
: millisecondsus
or µs
: microsecondsns
: nanosecondsinput
- the String
to convertpublic int getMonths()
public int getDays()
public long getNanoseconds()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2009- The Apache Software Foundation