Interface IAnyAtomicItem

All Superinterfaces:
IAtomicValuedItem, ICollectionValue, IItem
All Known Subinterfaces:
IAnyUriItem, IBase64BinaryItem, dev.metaschema.core.metapath.item.atomic.impl.IBinaryItem, IBooleanItem, ICalendarTemporalItem, IDateItem, IDateTimeItem, IDateTimeWithTimeZoneItem, IDateWithTimeZoneItem, IDayTimeDurationItem, IDecimalItem, IDurationItem, IEmailAddressItem, IHexBinaryItem, IHostnameItem, IIntegerItem, IIPAddressItem, IIPv4AddressItem, IIPv6AddressItem, IMarkupItem, IMarkupLineItem, IMarkupMultilineItem, INcNameItem, INonNegativeIntegerItem, INumericItem, IPositiveIntegerItem, IQNameItem, IStringItem, ITemporalItem, ITimeItem, ITimeWithTimeZoneItem, ITokenItem, IUntypedAtomicItem, IUriReferenceItem, IUuidItem, IYearMonthDurationItem
All Known Implementing Classes:
AbstractAnyAtomicItem, AbstractAtomicItemBase, AbstractUntypedAtomicItem, NullJavaTypeAdapter.VoidItem

public interface IAnyAtomicItem extends IAtomicValuedItem
The interface shared by all atomic items, representing indivisible data values that serve as the fundamental building blocks for complex data structures in the Metaschema framework.
  • Method Details

    • type

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

      @NonNull default IAnyAtomicItem toAtomicItem()
      Description copied from interface: IItem
      Get the atomic value for the item. This may be the same item if the item is an instance of IAnyAtomicItem.

      An implementation of item atomization.

      Specified by:
      toAtomicItem in interface IItem
      Returns:
      the atomic value or null if the item has no available value
    • getValue

      @NonNull Object getValue()
      Get the "wrapped" value represented by this item.
      Specified by:
      getValue in interface IItem
      Returns:
      the value
    • asStringItem

      @NonNull default IStringItem asStringItem()
      Converts this atomic item to a string item representation.
      Returns:
      a new IStringItem containing the string representation of this item
      See Also:
    • asString

      @NonNull String asString()
      Get the item's string value.
      Returns:
      the string value value of the item
    • atomize

      default Stream<IAnyAtomicItem> atomize()
      Description copied from interface: IItem
      Produce a stream of atomic items based on the atomic value of these items.

      Supports item atomization.

      Specified by:
      atomize in interface ICollectionValue
      Specified by:
      atomize in interface IItem
      Returns:
      a stream of atomized atomic items.
    • asMapKey

      @NonNull IMapKey asMapKey()
      Get the atomic item value as a map key for use with an IMapItem.
      Returns:
      the map key
    • getJavaTypeAdapter

      @NonNull IDataTypeAdapter<?> getJavaTypeAdapter()
      Get the item's type adapter.
      Returns:
      the type adapter for the item
    • cast

      static IAnyAtomicItem cast(@NonNull IAnyAtomicItem item)
      Cast the provided type to this item type.

      This method simply returns the provided item, since it is already the same type.

      Parameters:
      item - the item to cast
      Returns:
      the provided item
    • castAsType

      @NonNull IAnyAtomicItem castAsType(@NonNull IAnyAtomicItem item)
      Cast the provided item to be the same type as this item.
      Parameters:
      item - the item to cast
      Returns:
      an atomic item of this type
      Throws:
      InvalidValueForCastFunctionException - if the provided item type cannot be cast to this item type
    • deepEquals

      boolean deepEquals(@Nullable ICollectionValue other)
      Determine if this and the other value are deeply equal, without relying on the dynamic context.

      This is used by IMapKey.isSameKey(IMapKey) to determine key equivalence.

      Item equality is defined by the XPath 3.1 fn:deep-equal specification.

      Parameters:
      other - the other value to compare to this value to
      Returns:
      the true if the two values are equal, or false otherwise
    • accept

      default void accept(IItemVisitor visitor)
      Description copied from interface: IItem
      A visitor callback used to visit a variety of Metapath item types.
      Specified by:
      accept in interface IItem
      Parameters:
      visitor - the visitor to call back