Interface IBooleanItem

All Superinterfaces:
IAnyAtomicItem, IAtomicValuedItem, ICollectionValue, IItem

public interface IBooleanItem extends IAnyAtomicItem
An atomic Metapath item with a boolean value.
  • Field Details

    • TRUE

      @NonNull static final IBooleanItem TRUE
      The boolean item value of true.
    • FALSE

      @NonNull static final IBooleanItem FALSE
      The boolean item value of false.
  • Method Details

    • type

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

      default IAtomicOrUnionType<IBooleanItem> 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 IBooleanItem valueOf(@NonNull String value)
      Construct a new boolean item using the provided string value.

      The item will be TRUE if the value is "1" or "true", or FALSE otherwise

      Parameters:
      value - a string representing a boolean value
      Returns:
      the new item
      Throws:
      InvalidTypeMetapathException - if the provided value is not a valid boolean value
    • valueOf

      @NonNull static IBooleanItem valueOf(boolean value)
      Construct a new boolean item using the provided value.
      Parameters:
      value - a boolean
      Returns:
      the new item
    • cast

      @NonNull static IBooleanItem 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 IBooleanItem 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
    • toBoolean

      boolean toBoolean()
      Get the "wrapped" boolean value.
      Returns:
      the underlying boolean value
    • negate

      @NonNull default IBooleanItem negate()
      Get the boolean negation of this value.
      Returns:
      the negated boolean value
    • compareTo

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