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:
 - Serialized Form
 
 
- 
- 
Constructor Summary
Constructors Constructor Description AbstractServiceExceptionBuilder() 
- 
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Tbuild()Build the service exception.protected abstract TbuildWith(int httpStatus, String errorCode)Build the service exception with the given values.protected abstract TbuildWith(int httpStatus, String errorCode, String reason)Build the service exception with the given values.protected abstract TbuildWith(int httpStatus, String errorCode, String reason, Throwable cause)Build the service exception with the given values.protected abstract TbuildWith(int httpStatus, String errorCode, Throwable cause)Build the service exception with the given values.ServiceExceptionBuilder<T>cause(Throwable cause)sets cause on service exception builder.ServiceExceptionBuilder<T>errorCode(String errorCode)Sets error code on service exception builder.ServiceExceptionBuilder<T>httpStatus(int httpStatus)Sets http status on service exception builder.ServiceExceptionBuilder<T>reason(String reason)Sets reason on service exception builder. 
 - 
 
- 
- 
Method Detail
- 
httpStatus
public ServiceExceptionBuilder<T> httpStatus(int httpStatus)
Description copied from interface:ServiceExceptionBuilderSets http status on service exception builder.- Specified by:
 httpStatusin interfaceServiceExceptionBuilder<T extends ServiceException>- Parameters:
 httpStatus- the http status- Returns:
 - the service exception builder
 
 
- 
errorCode
public ServiceExceptionBuilder<T> errorCode(String errorCode)
Description copied from interface:ServiceExceptionBuilderSets error code on service exception builder.- Specified by:
 errorCodein interfaceServiceExceptionBuilder<T extends ServiceException>- Parameters:
 errorCode- the error code- Returns:
 - the service exception builder
 
 
- 
reason
public ServiceExceptionBuilder<T> reason(String reason)
Description copied from interface:ServiceExceptionBuilderSets reason on service exception builder.- Specified by:
 reasonin interfaceServiceExceptionBuilder<T extends ServiceException>- Parameters:
 reason- the reason- Returns:
 - the service exception builder
 
 
- 
cause
public ServiceExceptionBuilder<T> cause(Throwable cause)
Description copied from interface:ServiceExceptionBuildersets cause on service exception builder.- Specified by:
 causein interfaceServiceExceptionBuilder<T extends ServiceException>- Parameters:
 cause- the cause- Returns:
 - the service exception builder
 
 
- 
build
public T build()
Description copied from interface:ServiceExceptionBuilderBuild the service exception.- Specified by:
 buildin interfaceServiceExceptionBuilder<T extends ServiceException>- Returns:
 - the service exception
 
 
- 
buildWith
protected abstract T buildWith(int httpStatus, String errorCode)
Build the service exception with the given values.- Parameters:
 httpStatus- the http statuserrorCode- the error code- Returns:
 - the service exception
 
 
- 
buildWith
protected abstract T buildWith(int httpStatus, String errorCode, String reason)
Build the service exception with the given values.- Parameters:
 httpStatus- the http statuserrorCode- the error codereason- the reason- Returns:
 - the service exception
 
 
- 
buildWith
protected abstract T buildWith(int httpStatus, String errorCode, Throwable cause)
Build the service exception with the given values.- Parameters:
 httpStatus- the http statuserrorCode- the error codecause- the cause- Returns:
 - the t
 
 
 - 
 
 -