Package org.bremersee.exception
Class AbstractServiceExceptionBuilder<T extends ServiceException>
java.lang.Object
org.bremersee.exception.AbstractServiceExceptionBuilder<T>
- Type Parameters:
T
- the exception type
- All Implemented Interfaces:
Serializable
,ServiceExceptionBuilder<T>
public abstract class AbstractServiceExceptionBuilder<T extends ServiceException>
extends Object
implements ServiceExceptionBuilder<T>
The abstract service exception builder.
- Author:
- Christian Bremer
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the service exception.protected T
Build the service exception with the given values.protected T
Build the service exception with the given values.protected abstract T
Build the service exception with the given values.protected T
Build the service exception with the given values.Sets cause on service exception builder.Sets error code on service exception builder.from
(ServiceException serviceException) From another service exception.httpStatus
(int httpStatus) Sets http status on service exception builder.Sets reason on service exception builder.
-
Field Details
-
httpStatus
protected int httpStatusThe http status. -
reason
The reason. -
errorCode
The error code. -
cause
The cause.
-
-
Constructor Details
-
AbstractServiceExceptionBuilder
public AbstractServiceExceptionBuilder()
-
-
Method Details
-
httpStatus
Description copied from interface:ServiceExceptionBuilder
Sets http status on service exception builder.- Specified by:
httpStatus
in interfaceServiceExceptionBuilder<T extends ServiceException>
- Parameters:
httpStatus
- the http status- Returns:
- the service exception builder
-
errorCode
Description copied from interface:ServiceExceptionBuilder
Sets error code on service exception builder.- Specified by:
errorCode
in interfaceServiceExceptionBuilder<T extends ServiceException>
- Parameters:
errorCode
- the error code- Returns:
- the service exception builder
-
reason
Description copied from interface:ServiceExceptionBuilder
Sets reason on service exception builder.- Specified by:
reason
in interfaceServiceExceptionBuilder<T extends ServiceException>
- Parameters:
reason
- the reason- Returns:
- the service exception builder
-
cause
Description copied from interface:ServiceExceptionBuilder
Sets cause on service exception builder.- Specified by:
cause
in interfaceServiceExceptionBuilder<T extends ServiceException>
- Parameters:
cause
- the cause- Returns:
- the service exception builder
-
from
Description copied from interface:ServiceExceptionBuilder
From another service exception.- Specified by:
from
in interfaceServiceExceptionBuilder<T extends ServiceException>
- Parameters:
serviceException
- the other service exception- Returns:
- the service exception builder
-
build
Description copied from interface:ServiceExceptionBuilder
Build the service exception.- Specified by:
build
in interfaceServiceExceptionBuilder<T extends ServiceException>
- Returns:
- the service exception
-
buildWith
Build the service exception with the given values.- Parameters:
httpStatus
- the http statuserrorCode
- the error code- Returns:
- the service exception
-
buildWith
Build the service exception with the given values.- Parameters:
httpStatus
- the http statuserrorCode
- the error codereason
- the reason- Returns:
- the service exception
-
buildWith
Build the service exception with the given values.- Parameters:
httpStatus
- the http statuserrorCode
- the error codecause
- the cause- Returns:
- the t
-
buildWith
Build the service exception with the given values.- Parameters:
httpStatus
- the http statuserrorCode
- the error codereason
- the reasoncause
- the cause- Returns:
- the t
-