Class IOResult

java.lang.Object
org.apache.pekko.stream.IOResult
All Implemented Interfaces:
Serializable, scala.Equals, scala.Product

public final class IOResult extends Object implements scala.Product, Serializable
Holds a result of an IO operation.

param: count Numeric value depending on context, for example IO operations performed or bytes processed. param: status Status of the result. Can be either pekko.Done or an exception.

See Also:
  • Constructor Details

    • IOResult

      public IOResult(long count, scala.util.Try<Done> status)
  • Method Details

    • apply

      public static IOResult apply(long count)
    • createSuccessful

      public static IOResult createSuccessful(long count)
      JAVA API: Creates successful IOResult
    • createFailed

      public static IOResult createFailed(long count, Throwable ex)
      JAVA API: Creates failed IOResult, `count` should be the number of bytes (or other unit, please document in your APIs) processed before failing
    • apply

      public static IOResult apply(long count, scala.util.Try<Done> status)
    • unapply

      public static scala.Option<scala.Tuple2<Object,scala.util.Try<Done>>> unapply(IOResult x$0)
    • count

      public long count()
    • status

      public scala.util.Try<Done> status()
    • withCount

      public IOResult withCount(long value)
      Creates a new IOResult with the given count and the same status.
    • withStatus

      public IOResult withStatus(scala.util.Try<Done> value)
      Creates a new IOResult with the given status and the same count.
    • getCount

      public long getCount()
      Java API: Numeric value depending on context, for example IO operations performed or bytes processed.
    • wasSuccessful

      public boolean wasSuccessful()
      Java API: Indicates whether IO operation completed successfully or not.
    • getError

      public Throwable getError()
      Java API: If the IO operation resulted in an error, returns the corresponding Throwable or throws UnsupportedOperationException otherwise.
    • copy

      public IOResult copy(long count, scala.util.Try<Done> status)
    • copy$default$1

      public long copy$default$1()
    • copy$default$2

      public scala.util.Try<Done> copy$default$2()
    • productPrefix

      public String productPrefix()
      Specified by:
      productPrefix in interface scala.Product
    • productArity

      public int productArity()
      Specified by:
      productArity in interface scala.Product
    • productElement

      public Object productElement(int x$1)
      Specified by:
      productElement in interface scala.Product
    • productIterator

      public scala.collection.Iterator<Object> productIterator()
      Specified by:
      productIterator in interface scala.Product
    • canEqual

      public boolean canEqual(Object x$1)
      Specified by:
      canEqual in interface scala.Equals
    • productElementName

      public String productElementName(int x$1)
      Specified by:
      productElementName in interface scala.Product
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

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

      public boolean equals(Object x$1)
      Specified by:
      equals in interface scala.Equals
      Overrides:
      equals in class Object