public class DayTimeDuration extends DataValue
Represents the XML Schema dayTimeDuration type.
Modifier and Type | Method and Description |
---|---|
static DayTimeDuration |
castOptional(DataValue value)
For internal use only.
|
static DayTimeDuration |
castRequired(DataValue value)
For internal use only.
|
static int |
compare(DayTimeDuration left,
DayTimeDuration right)
Compare two dayTimeDuration values.
|
int |
compareTo(DayTimeDuration value)
Compare this dayTimeDuration with another dayTimeDuration.
|
static boolean |
equal(DayTimeDuration left,
DayTimeDuration right)
Compare two dayTimeDuration values.
|
boolean |
equals(java.lang.Object value)
Compare this dayTimeDuration value with another dayTimeDuration value.
|
DataType |
getDataType()
Return data type of the wrapped value.
|
int |
getDays()
Return days field of duration (non-negative).
|
int |
getHours()
Return hours field of duration (non-negative).
|
int |
getMinutes()
Return minutes field of duration (non-negative).
|
int |
getNanos()
Return nanoseconds field of duration (non-negative).
|
int |
getSeconds()
Return seconds field of duration (non-negative).
|
int |
getSign()
Return sign of the duration (+1, 0 or -1).
|
boolean |
greaterEqual(DayTimeDuration value)
Compare this dayTimeDuration value with another dayTimeDuration value.
|
boolean |
greaterThan(DayTimeDuration value)
Compare this dayTimeDuration value with another dayTimeDuration value.
|
int |
hashCode()
Hash this data value to a number.
|
boolean |
lessEqual(DayTimeDuration value)
Compare this dayTimeDuration value with another dayTimeDuration value.
|
boolean |
lessThan(DayTimeDuration value)
Compare this dayTimeDuration value with another dayTimeDuration value.
|
DayTimeDuration |
normalize()
Return an equivalent value with all fields normalized.
|
boolean |
notEqual(DayTimeDuration value)
Compare this dayTimeDuration value with another dayTimeDuration value.
|
static DayTimeDuration |
of(int sign,
int days,
int hours,
int minutes,
int seconds)
|
static DayTimeDuration |
of(int sign,
int days,
int hours,
int minutes,
int seconds,
int nanos)
Return a new day/time duration.
|
static DayTimeDuration |
ofDecimal(java.math.BigDecimal seconds)
Return a new day/time duration.
|
static DayTimeDuration |
parse(java.lang.String text)
|
static boolean |
static_greaterEqual(DayTimeDuration left,
DayTimeDuration right)
Compare two dayTimeDuration values.
|
static boolean |
static_greaterThan(DayTimeDuration left,
DayTimeDuration right)
Compare two dayTimeDuration values.
|
static boolean |
static_lessEqual(DayTimeDuration left,
DayTimeDuration right)
Compare two dayTimeDuration values.
|
static boolean |
static_lessThan(DayTimeDuration left,
DayTimeDuration right)
Compare two dayTimeDuration values.
|
static boolean |
static_notEqual(DayTimeDuration left,
DayTimeDuration right)
Compare two dayTimeDuration values.
|
java.math.BigDecimal |
toDecimal()
Return duration expressed as decimal seconds with optional fraction.
|
java.lang.String |
toString()
Convert this data value to a string.
|
cloneMutable, getTypeCode
public static DayTimeDuration castOptional(DataValue value)
For internal use only.
value
- (internal use only)public static DayTimeDuration castRequired(DataValue value)
For internal use only.
value
- (internal use only)public static int compare(DayTimeDuration left, DayTimeDuration right)
Compare two dayTimeDuration values.
left
- The first dayTimeDuration for comparison.right
- The second dayTimeDuration for comparison.left < right
, 0 if left == right
, or 1 if left > right
.public int compareTo(DayTimeDuration value)
Compare this dayTimeDuration with another dayTimeDuration.
value
- The other dayTimeDuration.public static boolean equal(DayTimeDuration left, DayTimeDuration right)
Compare two dayTimeDuration values.
left
- (nullable) The first dayTimeDuration for comparison.right
- (nullable) The second dayTimeDuration for comparison.true
if left
is equal to right
, otherwise false
.public boolean equals(java.lang.Object value)
Compare this dayTimeDuration value with another dayTimeDuration value.
public DataType getDataType()
Return data type of the wrapped value.
getDataType
in class DataValue
public int getDays()
Return days field of duration (non-negative).
public int getHours()
Return hours field of duration (non-negative).
public int getMinutes()
Return minutes field of duration (non-negative).
public int getNanos()
Return nanoseconds field of duration (non-negative).
public int getSeconds()
Return seconds field of duration (non-negative).
public int getSign()
Return sign of the duration (+1, 0 or -1).
public boolean greaterEqual(DayTimeDuration value)
Compare this dayTimeDuration value with another dayTimeDuration value.
value
- The other dayTimeDuration value.true
if this dayTimeDuration value is greater than or equal to the value dayTimeDuration value. Oherwise false
.public boolean greaterThan(DayTimeDuration value)
Compare this dayTimeDuration value with another dayTimeDuration value.
value
- The other dayTimeDuration value.true
if this dayTimeDuration value is greater than the value dayTimeDuration value. Oherwise false
.public int hashCode()
Hash this data value to a number.
public boolean lessEqual(DayTimeDuration value)
Compare this dayTimeDuration value with another dayTimeDuration value.
value
- The other dayTimeDuration value.true
if this dayTimeDuration value is less than or equal to the value dayTimeDuration value. Oherwise false
.public boolean lessThan(DayTimeDuration value)
Compare this dayTimeDuration value with another dayTimeDuration value.
value
- The other dayTimeDuration value.true
if this dayTimeDuration value is less than the value dayTimeDuration value. Oherwise false
.public DayTimeDuration normalize()
Return an equivalent value with all fields normalized.
The result value will have nanos < 1000000000, seconds < 60, minutes < 60, hours < 24.
The result value will be DayTimeDuration.equal
to this value.
public boolean notEqual(DayTimeDuration value)
Compare this dayTimeDuration value with another dayTimeDuration value.
value
- The other dayTimeDuration value.true
if this dayTimeDuration value is not equal to the value dayTimeDuration value. Oherwise false
.public static DayTimeDuration of(int sign, int days, int hours, int minutes, int seconds)
sign
- Sign parameter.days
- Days parameter.hours
- Hours parameter.minutes
- Minutes parameter.seconds
- Seconds parameter.public static DayTimeDuration of(int sign, int days, int hours, int minutes, int seconds, int nanos)
Return a new day/time duration.
sign
- The sign field (+1, 0 or -1).days
- The days field (non-negative).hours
- The hours field (non-negative).minutes
- The minutes field (non-negative).seconds
- The seconds field (non-negative).nanos
- The nanos field (non-negative, <= 999999999
).public static DayTimeDuration ofDecimal(java.math.BigDecimal seconds)
Return a new day/time duration.
seconds
- Duration expressed as decimal seconds with optional fraction.public static DayTimeDuration parse(java.lang.String text)
Return (nullable) Value parsed from XML Schema format, or null
if text
has invalid duration format.
text
- Value in XML Schema format.null
if text
has invalid duration format.public static boolean static_greaterEqual(DayTimeDuration left, DayTimeDuration right)
Compare two dayTimeDuration values.
left
- The first dayTimeDuration for comparison.right
- The second dayTimeDuration for comparison.true
if left
is greater than or equal to right
, otherwise false
.public static boolean static_greaterThan(DayTimeDuration left, DayTimeDuration right)
Compare two dayTimeDuration values.
left
- The first dayTimeDuration for comparison.right
- The second dayTimeDuration for comparison.true
if left
is greater than right
, otherwise false
.public static boolean static_lessEqual(DayTimeDuration left, DayTimeDuration right)
Compare two dayTimeDuration values.
left
- The first dayTimeDuration for comparison.right
- The second dayTimeDuration for comparison.true
if left
is less than or equal to right
, otherwise false
.public static boolean static_lessThan(DayTimeDuration left, DayTimeDuration right)
Compare two dayTimeDuration values.
left
- The first dayTimeDuration for comparison.right
- The second dayTimeDuration for comparison.true
if left
is less than right
, otherwise false
.public static boolean static_notEqual(DayTimeDuration left, DayTimeDuration right)
Compare two dayTimeDuration values.
left
- (nullable) The first dayTimeDuration for comparison.right
- (nullable) The second dayTimeDuration for comparison.true
if left
is not equal to right
, otherwise false
.public java.math.BigDecimal toDecimal()
Return duration expressed as decimal seconds with optional fraction.
public java.lang.String toString()
Convert this data value to a string.
If the DayTimeDuration.dataType
is defined by XML Schema Part 2: Datatypes, then the corresponding lexical format is used.
JSON format is used for structured values (arrays and objects).