Package com.sodius.oslc.server
Class OslcErrors.OslcErrorBuilder
- java.lang.Object
-
- com.sodius.oslc.server.OslcErrors.OslcErrorBuilder
-
- Enclosing class:
- OslcErrors
public static class OslcErrors.OslcErrorBuilder extends Object
A class used to build OslcError resources.- Since:
- 1.13.0
- See Also:
OslcErrors.status(Response.Status, OslcErrors.ErrorId, String)
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OslcErrorbuild()Builds the OSLC Error resource.OslcErrors.OslcErrorBuildercause(Throwable cause)Sets the exception that occurred on server side and that made it not able to properly respond to an incoming request.OslcErrors.OslcErrorBuilderdescription(String description)Sets a detailed error description, as a complement of the Error message, with possibly some steps for the user to resolve the problem.OslcErrors.OslcErrorBuilderremoteError(ClientWebException exception)Sets an exception that was raised when making a request on a remote server.
-
-
-
Method Detail
-
description
public OslcErrors.OslcErrorBuilder description(String description)
Sets a detailed error description, as a complement of the Error message, with possibly some steps for the user to resolve the problem.- Parameters:
description- the detailed error description.- Returns:
- this builder.
-
remoteError
public OslcErrors.OslcErrorBuilder remoteError(ClientWebException exception)
Sets an exception that was raised when making a request on a remote server.- Parameters:
exception- the remote server error response as an exception.- Returns:
- this builder.
-
cause
public OslcErrors.OslcErrorBuilder cause(Throwable cause)
Sets the exception that occurred on server side and that made it not able to properly respond to an incoming request.If the exception is a
ClientWebExceptionthat occurs while requesting a resource on a remote server, developer should rather use theremoteError(ClientWebException)method.- Parameters:
cause- the exception that occurred on server side.- Returns:
- this builder.
-
build
public OslcError build()
Builds the OSLC Error resource.- Returns:
- an OSLC Error resource.
-
-