GetTeamResponse(String)   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
1
package com.base.Http.Server.Responses.Team;
2
3
import com.base.Http.Request.Request;
4
import com.base.Http.Response.Response;
5
import com.base.Http.Server.Responses.BaseResponse;
6
import com.base.Models.Team;
7
8
public class GetTeamResponse extends BaseResponse {
9
10
    public static String VALID_TEAM_SLUG = "twitter";
11
    public static String VALID_NAME = "Twitter";
12
    public static String VALID_DESCRIPTION = "Design Team for Twitter";
13
    public static String VALID_INVITATION_CODE = "Twitter-RD4Uccxjz0ugB2GXa94w";
14
    public static int VALID_ID = 1;
15
16
    public GetTeamResponse() {
17
        super();
18
    }
19
20
    public GetTeamResponse(String teamSlug) {
21
        super();
22
        VALID_TEAM_SLUG = teamSlug;
23
    }
24
25
    @Override
26
    public Response getResponse(Request request, Response response) {
27
        return response.setStatusCode(200)
28
                .setBody(generateResponseBody(getTeam()));
29
    }
30
31
    public Team getTeam() {
32
        return (Team) new Team()
33
                .setSlug(VALID_TEAM_SLUG)
34
                .setDescription(VALID_DESCRIPTION)
35
                .setName(VALID_NAME)
36
                .setInvitation_code(VALID_INVITATION_CODE)
37
                .setId(VALID_ID);
38
39
    }
40
}
41
42