Class ItemWithContext<T>

  • Type Parameters:
    T - the iten type

    @Experimental("Context support is a new experimental API introduced in Mutiny 1.3.0")
    public final class ItemWithContext<T>
    extends java.lang.Object
    Models an item flowing along a Mutiny pipeline with its subscriber context attached.
    See Also:
    Uni.attachContext(), Multi.attachContext()
    • Constructor Summary

      Constructors 
      Constructor Description
      ItemWithContext​(Context context, T item)
      Creates a new item with a context.
    • Constructor Detail

      • ItemWithContext

        public ItemWithContext​(Context context,
                               T item)
        Creates a new item with a context.

        Since instances are being created by Mutiny operators there is no null check on parameters for performance reasons.

        Parameters:
        context - the context
        item - the item
    • Method Detail

      • context

        public Context context()
        Gives the context.
        Returns:
        the context
      • get

        public T get()
        Gives the item.
        Returns:
        the item
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object