Class SerializableErrorEntity
- java.lang.Object
-
- org.gcube.common.gxrest.response.entity.SerializableErrorEntity
-
public class SerializableErrorEntity extends Object
- Author:
- Manuele Simi (ISTI CNR)
-
-
Field Summary
Fields Modifier and Type Field Description protected static charENTITY_CHAR_SEPARATOR
-
Constructor Summary
Constructors Constructor Description SerializableErrorEntity()SerializableErrorEntity(Exception e)SerializableErrorEntity(Exception e, int lines)SerializableErrorEntity(ErrorCode errorCode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetEncodedTrace()StringgetExceptionClass()intgetId()StringgetMessage()booleanhasStackTrace()Checks if a stacktrace is available.protected voidsetEncodedTrace(String encodedTrace)Sets the enconded trace.protected voidsetExceptionClass(String exceptionClass)Sets the exception class.protected voidsetMessage(String message)Sets the message.
-
-
-
Field Detail
-
ENTITY_CHAR_SEPARATOR
protected static final char ENTITY_CHAR_SEPARATOR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SerializableErrorEntity
public SerializableErrorEntity()
-
SerializableErrorEntity
public SerializableErrorEntity(ErrorCode errorCode)
- Parameters:
errorCode- the errorc code to serialize
-
SerializableErrorEntity
public SerializableErrorEntity(Exception e)
- Parameters:
e- the exception to serialize
-
SerializableErrorEntity
public SerializableErrorEntity(Exception e, int lines)
- Parameters:
e- the exception to serializelines- the number of lines in the stacktrace to serialize
-
-
Method Detail
-
getId
public int getId()
-
getMessage
public String getMessage()
-
getExceptionClass
public String getExceptionClass()
- Returns:
- the full qualified name of the embedded
Exception
-
getEncodedTrace
public String getEncodedTrace()
- Returns:
- the encoded stacktrace
-
hasStackTrace
public boolean hasStackTrace()
Checks if a stacktrace is available.- Returns:
- true if a stacktrace is serialized in the entity.
-
setMessage
protected void setMessage(String message)
Sets the message.- Parameters:
message-
-
setExceptionClass
protected void setExceptionClass(String exceptionClass)
Sets the exception class.- Parameters:
exceptionClass-
-
setEncodedTrace
protected void setEncodedTrace(String encodedTrace)
Sets the enconded trace.- Parameters:
encodedTrace-
-
-