Interface IAnyUriItem

All Superinterfaces:
IAnyAtomicItem, IAtomicValuedItem, ICollectionValue, IItem
All Known Subinterfaces:
IUriReferenceItem

public interface IAnyUriItem extends IAnyAtomicItem
An atomic Metapath item containing a URI data value.
  • Method Details

    • type

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

      default IAtomicOrUnionType<? extends IAnyUriItem> 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 IAnyUriItem valueOf(@NonNull String value)
      Construct a new URI item using the provided string value.
      Parameters:
      value - a string representing a URI
      Returns:
      the new item
      Throws:
      InvalidTypeMetapathException - if the given string violates RFC2396
    • valueOf

      @NonNull static IAnyUriItem valueOf(@NonNull URI value)
      Construct a new URI item using the provided URI value.

      Example usage:

       URI uri = URI.create("http://example.com");
       IAnyUriItem item = IAnyUriItem.valueOf(uri);
       
      Parameters:
      value - a URI
      Returns:
      the new item as a IAnyUriItem if the URI is absolute or opaque, otherwise as an IUriReferenceItem
    • cast

      @NonNull static IAnyUriItem 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 IAnyUriItem 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
      Parameters:
      item - the item to cast
      Returns:
      an atomic item of this type
    • asUri

      @NonNull URI asUri()
      Get the "wrapped" URI value.
      Returns:
      the underlying URI value
    • isAbsolute

      default boolean isAbsolute()
      Determines if this URI has a scheme component, making it absolute.
      Returns:
      true if the URI is absolute, or false otherwise
    • isOpaque

      default boolean isOpaque()
      Determines if this URI is opaque.
      Returns:
      true if the URI is opaque, or false otherwise
      See Also:
    • resolve

      @NonNull default IAnyUriItem resolve(@NonNull IAnyUriItem other)
      Resolve the provided URI against this URI.
      Parameters:
      other - the URI to resolve
      Returns:
      the resolved URI
      See Also:
    • compareTo

      default int compareTo(@NonNull IAnyUriItem 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.