This class only stores the value if it implements Serializable.
In any case, it stores its runtime type, identity hash code, and string representation determined via String#valueOf(Object). If the invocation of String.valueOf(Object)
throws an Exception, the string representation will take the form of
"<Exception in toString(): " + e + ">", where "e" is the caught
exception.
The toString() method returns the string representation of the
value along with its type and identity hash code.
System#identityHashCode
| Modifier and Type | Field and Description |
|---|---|
| private final transient Object | |
| private final int | |
| private static final ValueWrapper | |
| private static final long | |
| private final String | |
| private final Class | |
| private final Serializable |
| Access | Constructor and Description |
|---|---|
| private | ValueWrapper(Object value, String stringRepresentation)
Reads and stores the supplied value's runtime type, string representation, and identity hash code. |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static ValueWrapper | |
| public static ValueWrapper | Returns: a wrapper for the supplied value; nevernullthe value to wrap; may be value, String nulla custom rendering of the value; will fallback to
the default behavior if stringRepresentation)nullFactory for creating a new |
| public Object | |
| public int | |
| public String | |
| public Class | |
| public Serializable | getValue()
Returns the value supplied to |
| private static String | |
| public String | toString()
Overrides java. |
| ephemeralValue | back to summary |
|---|---|
| private final transient Object ephemeralValue | |
| identityHashCode | back to summary |
|---|---|
| private final int identityHashCode | |
| nullValueWrapper | back to summary |
|---|---|
| private static final ValueWrapper nullValueWrapper | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| stringRepresentation | back to summary |
|---|---|
| private final String stringRepresentation | |
| type | back to summary |
|---|---|
| private final Class<?> type | |
| value | back to summary |
|---|---|
| private final Serializable value | |
| ValueWrapper | back to summary |
|---|---|
| private ValueWrapper(Object value, String stringRepresentation) Reads and stores the supplied value's runtime type, string representation, and identity hash code. | |
| ValueWrapper | back to summary |
|---|---|
| private ValueWrapper(Object value) | |
| create | back to summary |
|---|---|
| public static ValueWrapper create(Object value) Factory for creating a new If the supplied
| |
| create | back to summary |
|---|---|
| public static ValueWrapper create(Object value, String stringRepresentation) Factory for creating a new You should use this method when you don't want to rely on the result of the
value's If the supplied
| |
| getEphemeralValue | back to summary |
|---|---|
| public Object getEphemeralValue() Returns the original value supplied to If this
| |
| getIdentityHashCode | back to summary |
|---|---|
| public int getIdentityHashCode() Returns the value's identity hash code. The identity hash code is generated by invoking
| |
| getStringRepresentation | back to summary |
|---|---|
| public String getStringRepresentation() Returns the value's string representation. The string representation is generated by invoking
| |
| getType | back to summary |
|---|---|
| public Class Returns the value's runtime type or | |
| getValue | back to summary |
|---|---|
| public Serializable getValue() Returns the value supplied to
| |
| safeValueToString | back to summary |
|---|---|
| private static String safeValueToString(Object value) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns the value's string representation along with its type and identity hash code.
| |