Interface IDayTimeDurationItem

All Superinterfaces:
IAnyAtomicItem, IAtomicValuedItem, ICollectionValue, IDurationItem, IItem

public interface IDayTimeDurationItem extends IDurationItem
An atomic Metapath item containing a duration data value in days, hours, and seconds.
  • Method Details

    • type

      @NonNull static IAtomicOrUnionType<IDayTimeDurationItem> type()
      Get the type information for this item.
      Returns:
      the type information
    • getType

      Description copied from interface: IItem
      Get the type information for the item.
      Specified by:
      getType in interface IItem
      Returns:
      the item's type information
    • valueOf

      @NonNull static IDayTimeDurationItem valueOf(@NonNull String value)
      Construct a new day time duration item using the provided string value.
      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

      @NonNull static IDayTimeDurationItem valueOf(@NonNull Duration value)
      Construct a new day time duration item using the provided value.
      Parameters:
      value - a duration
      Returns:
      the new item
    • asDuration

      @NonNull Duration 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

      @NonNull default IDayTimeDurationItem negate()
      Returns a copy of this duration with the amount negated.
      Returns:
      this duration with the amount negated
    • cast

      @NonNull static IDayTimeDurationItem cast(@NonNull IAnyAtomicItem item)
      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 provided item cannot be cast to this type
    • castAsType

      default IDayTimeDurationItem castAsType(IAnyAtomicItem item)
      Description copied from interface: IAnyAtomicItem
      Cast the provided item to be the same type as this item.
      Specified by:
      castAsType in interface IAnyAtomicItem
      Specified by:
      castAsType in interface IDurationItem
      Parameters:
      item - the item to cast
      Returns:
      an atomic item of this type
    • compareTo

      default int compareTo(@NonNull IDayTimeDurationItem item)
      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

      @NonNull ZoneOffset asZoneOffset()
      Get a zone offset for this duration.
      Returns:
      the offset
      Throws:
      DateTimeFunctionException - with code DateTimeFunctionException.INVALID_TIME_ZONE_VALUE_ERROR if the offset is < -PT14H or > PT14H