Package org.apache.pekko.stream
Class IOResult
java.lang.Object
org.apache.pekko.stream.IOResult
- All Implemented Interfaces:
Serializable,scala.Equals,scala.Product
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IOResultapply(long count) static IOResultbooleanlongscala.util.Try<Done>longcount()static IOResultcreateFailed(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 failingstatic IOResultcreateSuccessful(long count) JAVA API: Creates successful IOResultbooleanlonggetCount()Java API: Numeric value depending on context, for example IO operations performed or bytes processed.getError()Java API: If the IO operation resulted in an error, returns the correspondingThrowableor throwsUnsupportedOperationExceptionotherwise.inthashCode()intproductElement(int x$1) productElementName(int x$1) scala.collection.Iterator<Object>scala.util.Try<Done>status()toString()booleanJava API: Indicates whether IO operation completed successfully or not.withCount(long value) Creates a new IOResult with the given count and the same status.withStatus(scala.util.Try<Done> value) Creates a new IOResult with the given status and the same count.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface scala.Product
productElementNames
-
Constructor Details
-
IOResult
-
-
Method Details
-
apply
-
createSuccessful
JAVA API: Creates successful IOResult -
createFailed
JAVA API: Creates failed IOResult, `count` should be the number of bytes (or other unit, please document in your APIs) processed before failing -
apply
-
unapply
-
count
public long count() -
status
-
withCount
Creates a new IOResult with the given count and the same status. -
withStatus
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
Java API: If the IO operation resulted in an error, returns the correspondingThrowableor throwsUnsupportedOperationExceptionotherwise. -
copy
-
copy$default$1
public long copy$default$1() -
copy$default$2
-
productPrefix
- Specified by:
productPrefixin interfacescala.Product
-
productArity
public int productArity()- Specified by:
productArityin interfacescala.Product
-
productElement
- Specified by:
productElementin interfacescala.Product
-
productIterator
- Specified by:
productIteratorin interfacescala.Product
-
canEqual
- Specified by:
canEqualin interfacescala.Equals
-
productElementName
- Specified by:
productElementNamein interfacescala.Product
-
hashCode
public int hashCode() -
toString
-
equals
-