Package org.apache.beam.sdk.values
Class EncodableThrowable
- java.lang.Object
-
- org.apache.beam.sdk.values.EncodableThrowable
-
- All Implemented Interfaces:
java.io.Serializable
public final class EncodableThrowable extends java.lang.Object implements java.io.Serializable
A wrapper around aThrowable
for use with coders.Though
Throwable
is serializable, it doesn't overrideObject.equals(Object)
, which can lead to false positives in mutation detection for coders. This class provides a coder- safe way to pass exceptions around without running into problems like log spam.This class is not suitable for general-purpose equality comparison among
Throwable
s and should only be used to pass aThrowable
from one PTransform to another.- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
static EncodableThrowable
forThrowable(java.lang.Throwable throwable)
Wrapsthrowable
and returns the result.int
hashCode()
java.lang.Throwable
throwable()
Returns the underlyingThrowable
.
-
-
-
Method Detail
-
forThrowable
public static EncodableThrowable forThrowable(java.lang.Throwable throwable)
Wrapsthrowable
and returns the result.
-
throwable
public java.lang.Throwable throwable()
Returns the underlyingThrowable
.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(@Nullable java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-