setResponse(Response)   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
1
package com.base.Exceptions;
2
3
import com.base.Http.Response.Response;
4
5
public class BaseHttpException extends BaseException {
6
7
    /**
8
     * HTTP {@link Response}
9
     */
10
    protected Response response;
0 ignored issues
show
Best Practice introduced by
Exceptions generally should be immutable since they convey immutable data. Consider making the field response final.
Loading history...
Bug Best Practice introduced by
Fields like response in a serializable class should either be transient or serializable.
Loading history...
11
12
    /**
13
     * Constructs {@link BaseHttpException} with the specified code,message and response
14
     * @param code Status Code
15
     * @param message Error Message
16
     * @param response Response
17
     */
18
    public BaseHttpException(int code, String message, Response response) {
19
        super(code, message);
20
        this.response = response;
21
    }
22
23
    /**
24
     * Get the {@link Response}
25
     * @return Response
26
     */
27
    public Response getResponse() {
28
        return response;
29
    }
30
31
    /**
32
     * Construct {@link BaseHttpException} with response.
33
     * @param response Response
34
     * @return
35
     */
36
    public BaseHttpException setResponse(Response response) {
37
        this.response = response;
38
        return this;
39
    }
40
}
41