- All Superinterfaces:
IAnyAtomicItem,IAtomicValuedItem,ICollectionValue,IItem
- All Known Subinterfaces:
IDayTimeDurationItem,IYearMonthDurationItem
An atomic Metapath item representing a duration data value.
This interface supports both day-time and year-month duration formats following the ISO 8601 standard. Examples of valid durations include:
- P1Y2M (1 year, 2 months)
- P3DT4H5M (3 days, 4 hours, 5 minutes)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic IDurationItemcast(IAnyAtomicItem item) Cast the provided type to this item type.default IDurationItemcastAsType(IAnyAtomicItem item) Cast the provideditemto be the same type as this item.intcompareTo(IDurationItem item) Compares this value with the argument.getValue()Get the "wrapped" value represented by this item.static IAtomicOrUnionType<IDurationItem>type()Get the type information for this item.static IDurationItemConstruct a new duration item using the provided stringvalue.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.IItem
contentsAsSequence, flatten, getType, hasValue, toSequence
-
Method Details
-
type
Get the type information for this item.- Returns:
- the type information
-
valueOf
Construct a new 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 year/month or day/time duration value according to ISO 8601
-
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
-
getValue
TemporalAmount getValue()Description copied from interface:IAnyAtomicItemGet the "wrapped" value represented by this item.- Specified by:
getValuein interfaceIAnyAtomicItem- Specified by:
getValuein interfaceIItem- Returns:
- the value
-
castAsType
Description copied from interface:IAnyAtomicItemCast the provideditemto be the same type as this item.- Specified by:
castAsTypein interfaceIAnyAtomicItem- 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.
-