Module dev.metaschema.core
Interface IDayTimeDurationItem
- All Superinterfaces:
IAnyAtomicItem,IAtomicValuedItem,ICollectionValue,IDurationItem,IItem
An atomic Metapath item containing a duration data value in days, hours, and
seconds.
-
Method Summary
Modifier and TypeMethodDescriptionGet the items wrapped value as a duration.default longGet the "wrapped" duration value in seconds.Get a zone offset for this duration.static IDayTimeDurationItemcast(IAnyAtomicItem item) Cast the provided type to this item type.default IDayTimeDurationItemcastAsType(IAnyAtomicItem item) Cast the provideditemto be the same type as this item.default intCompares this value with the argument.default IAtomicOrUnionType<IDayTimeDurationItem>getType()Get the type information for the item.default IDayTimeDurationItemnegate()Returns a copy of this duration with the amount negated.type()Get the type information for this item.static IDayTimeDurationItemConstruct a new day time duration item using the provided stringvalue.static IDayTimeDurationItemConstruct a new day time duration item using the providedvalue.Methods inherited from interface dev.metaschema.core.metapath.item.atomic.IAnyAtomicItem
accept, asMapKey, asString, asStringItem, atomize, deepEquals, getJavaTypeAdapter, toAtomicItemMethods inherited from interface dev.metaschema.core.metapath.item.ICollectionValue
deepEquals, toSignatureMethods inherited from interface dev.metaschema.core.metapath.item.atomic.IDurationItem
compareTo, getValueMethods inherited from interface dev.metaschema.core.metapath.item.IItem
contentsAsSequence, flatten, hasValue, toSequence
-
Method Details
-
type
Get the type information for this item.- Returns:
- the type information
-
getType
Description copied from interface:IItemGet the type information for the item. -
valueOf
Construct a new day time duration item using the provided stringvalue.- Parameters:
value- a string representing a day time duration- Returns:
- the new item
- Throws:
InvalidTypeMetapathException- if the provided string value is not a day/time duration value according to ISO 8601
-
valueOf
Construct a new day time duration item using the providedvalue.- Parameters:
value- a duration- Returns:
- the new item
-
asDuration
Get the items wrapped value as a duration.- Returns:
- the wrapped value as a duration
-
asSeconds
default long asSeconds()Get the "wrapped" duration value in seconds.- Returns:
- the underlying duration in seconds
-
negate
Returns a copy of this duration with the amount negated.- Returns:
- this duration with the amount negated
-
cast
Cast the provided type to this item type.- Parameters:
item- the item to cast- Returns:
- the original item if it is already this type, otherwise a new item cast to this type
- Throws:
InvalidValueForCastFunctionException- if the provideditemcannot be cast to this type
-
castAsType
Description copied from interface:IAnyAtomicItemCast the provideditemto be the same type as this item.- Specified by:
castAsTypein interfaceIAnyAtomicItem- Specified by:
castAsTypein interfaceIDurationItem- Parameters:
item- the item to cast- Returns:
- an atomic item of this type
-
compareTo
Compares this value with the argument.- Parameters:
item- the item to compare with this value- Returns:
- a negative integer, zero, or a positive integer if this value is less
than, equal to, or greater than the
item.
-
asZoneOffset
Get a zone offset for this duration.- Returns:
- the offset
- Throws:
DateTimeFunctionException- with codeDateTimeFunctionException.INVALID_TIME_ZONE_VALUE_ERRORif the offset is < -PT14H or > PT14H
-