Interface IStringItem

All Superinterfaces:
IAnyAtomicItem, IAtomicValuedItem, ICollectionValue, IItem
All Known Subinterfaces:
IEmailAddressItem, IHostnameItem, INcNameItem, ITokenItem, IUuidItem

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

    • type

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

      default IAtomicOrUnionType<? extends IStringItem> 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 IStringItem valueOf(@NonNull String value)
      Construct a new item using the provided string value.
      Parameters:
      value - a string value that must conform to Metaschema string validation rules
      Returns:
      the new item
      Throws:
      InvalidTypeMetapathException - if the value fails string validation
    • encode

      default IBase64BinaryItem encode()
      Encode this string as base64.
      Returns:
      the base64 encoded text
    • cast

      @NonNull static IStringItem 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
    • asStringItem

      default IStringItem asStringItem()
      Description copied from interface: IAnyAtomicItem
      Converts this atomic item to a string item representation.
      Specified by:
      asStringItem in interface IAnyAtomicItem
      Returns:
      a new IStringItem containing the string representation of this item
      See Also:
    • castAsType

      default IStringItem 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
    • compareTo

      default int compareTo(@NonNull IStringItem other)
      Compares this value with the argument. Ordering is in lexical dictionary order.
      Parameters:
      other - 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.
    • normalizeSpace

      @NonNull IStringItem normalizeSpace()
      An implementation of fn::normalize-space.
      Returns:
      the normalized string value for this string
    • length

      default int length()
      Get the length of the string.
      Returns:
      the length