This implementation is serializable, however this is dependent on the values that are added also being serializable.
ContextedException, ContextedRuntimeException
| Modifier and Type | Field and Description |
|---|---|
| private final List | contextValues
The list storing the label-data pairs. |
| private static final long | serialVersionUID
The serialization version. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public DefaultExceptionContext | addContextValue(final String label, final Object value)
Implements org. Adds a contextual label-value pair into this context. |
| public List | getContextEntries()
Implements org. Gets the full list of label-value pairs defined in the contextual data. |
| public Set | getContextLabels()
Implements org. Gets the full set of labels defined in the contextual data. |
| public List | getContextValues(final String label)
Implements org. Gets all the contextual data values associated with the label. |
| public Object | getFirstContextValue(final String label)
Implements org. Gets the first available contextual data value associated with the label. |
| public String | Returns: the exception message with context information appended, never nullthe base exception message without context information appended baseMessage)Implements org. Builds the message containing the contextual information. |
| public DefaultExceptionContext | setContextValue(final String label, final Object value)
Implements org. Sets a contextual label-value pair into this context. |
| private Stream |
| contextValues | back to summary |
|---|---|
| private final List<Pair<String, Object>> contextValues The list storing the label-data pairs. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID The serialization version. | |
| DefaultExceptionContext | back to summary |
|---|---|
| public DefaultExceptionContext() Constructs a new instance. | |
| addContextValue | back to summary |
|---|---|
| public DefaultExceptionContext addContextValue(final String label, final Object value) Implements org. Doc from org. Adds a contextual label-value pair into this context. The pair will be added to the context, independently of an already existing pair with the same label.
| |
| getContextEntries | back to summary |
|---|---|
| public List Implements org. Doc from org. Gets the full list of label-value pairs defined in the contextual data.
| |
| getContextLabels | back to summary |
|---|---|
| public Set Implements org. Doc from org. Gets the full set of labels defined in the contextual data.
| |
| getContextValues | back to summary |
|---|---|
| public List Implements org. Doc from org. Gets all the contextual data values associated with the label.
| |
| getFirstContextValue | back to summary |
|---|---|
| public Object getFirstContextValue(final String label) Implements org. Doc from org. Gets the first available contextual data value associated with the label.
| |
| getFormattedExceptionMessage | back to summary |
|---|---|
| public String getFormattedExceptionMessage(final String baseMessage) Implements org. Builds the message containing the contextual information. | |
| setContextValue | back to summary |
|---|---|
| public DefaultExceptionContext setContextValue(final String label, final Object value) Implements org. Doc from org. Sets a contextual label-value pair into this context. The pair will be added normally, but any existing label-value pair with the same label is removed from the context.
| |
| stream | back to summary |
|---|---|
| private Stream | |