com.base.Exceptions.BaseHttpException   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 34
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setResponse(Response) 0 3 1
setResponse 0 3 ?
A getResponse() 0 2 1
A BaseHttpException(int,String,Response) 0 3 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