Package org.junit.internal
Class SerializableValueDescription
- java.lang.Object
-
- org.junit.internal.SerializableValueDescription
-
- All Implemented Interfaces:
java.io.Serializable
class SerializableValueDescription extends java.lang.Object implements java.io.SerializableThis class exists solely to provide a serializable description of a value to be serialized as a field inAssumptionViolatedException. Being aThrowable, it is required to beSerializable, but a value of type Object provides no guarantee to be serializable. This class works around that limitation asAssumptionViolatedExceptiononly every uses the string representation of the value, while still retaining backwards compatibility with classes compiled against its class signature before 4.14 and/or deserialization of previously serialized instances.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringvalue
-
Constructor Summary
Constructors Modifier Constructor Description privateSerializableValueDescription(java.lang.Object value)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.ObjectasSerializableValue(java.lang.Object value)Factory method that checks to see if the value is already serializable.java.lang.StringtoString()
-
-
-
Method Detail
-
asSerializableValue
static java.lang.Object asSerializableValue(java.lang.Object value)
Factory method that checks to see if the value is already serializable.- Parameters:
value- the value to make serializable- Returns:
- The provided value if it is null or already serializable, the SerializableValueDescription representation of it if it is not.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-