Class Response
java.lang.Object
org.palladiosimulator.protocom.framework.java.ee.protocol.Response
- Direct Known Subclasses:
JsonResponse
,StringResponse
A Response object represents an HTTP response.
-
Field Summary
-
Constructor Summary
-
Method Summary
-
Field Details
-
OK
public static final int OK- See Also:
-
ALREADY_EXISTS
public static final int ALREADY_EXISTS- See Also:
-
INVALID
public static final int INVALID- See Also:
-
FAILED
public static final int FAILED- See Also:
-
MAPPER
protected static final com.fasterxml.jackson.databind.ObjectMapper MAPPER -
error
protected int error
-
-
Constructor Details
-
Response
public Response()Constructs a new Response object. -
Response
public Response(int error) Constructs a new Response object.- Parameters:
error
- the error code of the response
-
-
Method Details
-
getError
public int getError()Gets the error code of the response.- Returns:
- the error code of the response
-
setError
public void setError(int error) Sets the error code of the response.- Parameters:
error
- the error code of the response
-
toJson
Converts the response to JSON.- Returns:
- a JSON object string representing the response
-