public final class DurationValue extends Value implements TemporalAmount, Comparable<DurationValue>
| Modifier and Type | Class and Description |
|---|---|
static class |
DurationValue.Compiler<Input> |
| Modifier and Type | Field and Description |
|---|---|
static DurationValue |
MAX_VALUE |
static DurationValue |
MIN_VALUE |
static DurationValue |
ZERO |
| Modifier and Type | Method and Description |
|---|---|
DurationValue |
add(DurationValue that) |
Temporal |
addTo(Temporal temporal) |
static DurationValue |
approximate(double months,
double days,
double seconds,
double nanos)
Returns an approximation of the provided values by rounding to whole units and recalculating
the remainder into the smaller units.
|
TemporalAmount |
asObjectCopy()
Return this value as a regular java boxed primitive, String or primitive array.
|
static DurationValue |
between(TemporalUnit unit,
Temporal from,
Temporal to) |
static DurationValue |
build(MapValue map) |
int |
compareTo(DurationValue other) |
protected int |
computeHash() |
DurationValue |
div(NumberValue number) |
static DurationValue |
duration(Duration value) |
static DurationValue |
duration(long months,
long days,
long seconds,
long nanos) |
static DurationValue |
duration(Period value) |
boolean |
equals(boolean[] x) |
boolean |
equals(byte[] x) |
boolean |
equals(char[] x) |
boolean |
equals(double[] x) |
boolean |
equals(DurationValue[] x) |
boolean |
equals(float[] x) |
boolean |
equals(int[] x) |
boolean |
equals(LocalDate[] x) |
boolean |
equals(LocalDateTime[] x) |
boolean |
equals(LocalTime[] x) |
boolean |
equals(long[] x) |
boolean |
equals(OffsetTime[] x) |
boolean |
equals(short[] x) |
boolean |
equals(String[] x) |
boolean |
equals(Value other) |
boolean |
equals(ZonedDateTime[] x) |
LongValue |
get(String fieldName)
In contrast to
get(TemporalUnit), this method supports more units, namely: |
long |
get(TemporalUnit unit) |
String |
getTypeName() |
List<TemporalUnit> |
getUnits() |
<T> T |
map(ValueMapper<T> mapper) |
DurationValue |
mul(NumberValue number) |
NumberType |
numberType() |
static DurationValue |
parse(CharSequence text) |
static DurationValue |
parse(TextValue text) |
DurationValue |
plus(long amount,
TemporalUnit unit) |
String |
prettyPrint()
Returns a json-like string representation of the current value.
|
DurationValue |
sub(DurationValue that) |
Temporal |
subtractFrom(Temporal temporal) |
String |
toString() |
long |
updateHash(HashFunction hashFunction,
long hash) |
ValueGroup |
valueGroup() |
<E extends Exception> |
writeTo(ValueWriter<E> writer) |
asObject, eq, equals, equals, equals, equals, equals, hashCode64, isNaN, parseHeaderInformation, ternaryEquals, writeToequals, hashCode, isSequenceValuepublic static final DurationValue MIN_VALUE
public static final DurationValue MAX_VALUE
public static final DurationValue ZERO
public static DurationValue duration(Duration value)
public static DurationValue duration(Period value)
public static DurationValue duration(long months, long days, long seconds, long nanos)
public static DurationValue parse(CharSequence text)
public static DurationValue parse(TextValue text)
public static DurationValue build(MapValue map)
public static DurationValue between(TemporalUnit unit, Temporal from, Temporal to)
public int compareTo(DurationValue other)
compareTo in interface Comparable<DurationValue>public <E extends Exception> void writeTo(ValueWriter<E> writer) throws E extends Exception
public TemporalAmount asObjectCopy()
ValueasObjectCopy in class Valuepublic String getTypeName()
getTypeName in class AnyValuepublic String prettyPrint()
ValueprettyPrint in class Valuepublic ValueGroup valueGroup()
valueGroup in class Valuepublic NumberType numberType()
numberType in class Valueprotected int computeHash()
computeHash in class AnyValuepublic long updateHash(HashFunction hashFunction, long hash)
updateHash in class Valuepublic <T> T map(ValueMapper<T> mapper)
public long get(TemporalUnit unit)
get in interface TemporalAmountpublic LongValue get(String fieldName)
get(TemporalUnit), this method supports more units, namely:
years, hours, minutes, milliseconds, microseconds, monthsOfYear, minutesOfHour, secondsOfMinute, millisecondsOfSecond, microsecondsOfSecond, nanosecondsOfSecond
public List<TemporalUnit> getUnits()
getUnits in interface TemporalAmountpublic DurationValue plus(long amount, TemporalUnit unit)
public Temporal addTo(Temporal temporal)
addTo in interface TemporalAmountpublic Temporal subtractFrom(Temporal temporal)
subtractFrom in interface TemporalAmountpublic DurationValue add(DurationValue that)
public DurationValue sub(DurationValue that)
public DurationValue mul(NumberValue number)
public DurationValue div(NumberValue number)
public static DurationValue approximate(double months, double days, double seconds, double nanos)
public final boolean equals(ZonedDateTime[] x)
public final boolean equals(DurationValue[] x)
public final boolean equals(LocalDateTime[] x)
public final boolean equals(OffsetTime[] x)
Copyright © 2016–2021 MWARE SOLUTIONS. All rights reserved.