-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathResponse.java
69 lines (54 loc) · 1.61 KB
/
Response.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package httpwebserver.util;
import java.util.List;
public class Response {
private String httpVersion;
private String typeId;
private String typeDescription;
private List<String> head;
private String datas;
public Response(String httpVersion, String typeId, String typeDescription, List<String> head, String str) {
this.httpVersion = httpVersion;
this.typeId = typeId;
this.typeDescription = typeDescription;
this.head = head;
this.datas = str;
}
@Override
public String toString() {
String ret;
ret = this.httpVersion + " " + this.typeId + " " + this.typeDescription + "\r\n";
ret = head.stream().map((s) -> s).reduce(ret, String::concat);
ret += "\r\n";
return ret;
}
public void setHead(List<String> head) {
this.head = head;
}
public void setDatas(String str) {
this.datas = str;
}
public void setTypeId(String typeId) {
this.typeId = typeId;
}
public void setTypeDescription(String typeDescription) {
this.typeDescription = typeDescription;
}
public void setHttpVersion(String httpVersion) {
this.httpVersion = httpVersion;
}
public String getHttpVersion() {
return httpVersion;
}
public String getTypeDescription() {
return typeDescription;
}
public String getTypeId() {
return typeId;
}
public List<String> getHead() {
return head;
}
public String getDatas() {
return datas;
}
}