Package org.hobbit.core.data
Class ErrorData
java.lang.Object
org.hobbit.core.data.ErrorData
A simple data structure that represents errors that components can report.
- Author:
- Michael Röder (michael.roeder@uni-paderborn.de)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringID of the container reporting the error.protected StringA string that can be used as a short description of an error (optional, the error type description will be used as default).protected StringA string that contains details about the error, e.g., a stack trace (optional).protected StringIRI of the error type (optional).protected StringA string that can be used as short label of an error (optional, the error type label will be used as default) -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ErrorDatacreateFromException(Exception e, String containerName) Creates an instance of aHobbitErrors.UnhandledExceptionerror based on the data of the given exception.booleangetLabel()inthashCode()voidsetContainerId(String containerId) voidsetDescription(String description) voidsetDetails(String details) voidsetErrorType(String errorType) void
-
Field Details
-
containerName
ID of the container reporting the error. -
errorType
IRI of the error type (optional). -
label
A string that can be used as short label of an error (optional, the error type label will be used as default) -
description
A string that can be used as a short description of an error (optional, the error type description will be used as default). -
details
A string that contains details about the error, e.g., a stack trace (optional).
-
-
Constructor Details
-
ErrorData
public ErrorData()
-
-
Method Details
-
getContainerId
- Returns:
- the containerId
-
setContainerId
- Parameters:
containerId- the containerId to set
-
getErrorType
- Returns:
- the errorType
-
setErrorType
- Parameters:
errorType- the errorType to set
-
getLabel
- Returns:
- the label
-
setLabel
- Parameters:
label- the label to set
-
getDescription
- Returns:
- the description
-
setDescription
- Parameters:
description- the description to set
-
getDetails
- Returns:
- the details
-
setDetails
- Parameters:
details- the details to set
-
hashCode
public int hashCode() -
equals
-
createFromException
Creates an instance of aHobbitErrors.UnhandledExceptionerror based on the data of the given exception.- Parameters:
e- the exception that should be expressed as errorcontainerName- the ID of the container that reports the error- Returns:
- the newly created ErrorData instance or
nullif the given container name isnull.
-