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 package org.apache.hc.core5.http.support;
29
30 import org.apache.hc.core5.http.Header;
31 import org.apache.hc.core5.http.ProtocolVersion;
32 import org.apache.hc.core5.http.message.BasicHttpRequest;
33
34
35
36
37
38
39 public abstract class AbstractResponseBuilder<T> extends AbstractMessageBuilder<T> {
40
41 private int status;
42
43 protected AbstractResponseBuilder(final int status) {
44 super();
45 this.status = status;
46 }
47
48 public int getStatus() {
49 return status;
50 }
51
52 public void setStatus(final int status) {
53 this.status = status;
54 }
55
56 @Override
57 public AbstractResponseBuilder<T> setVersion(final ProtocolVersion version) {
58 super.setVersion(version);
59 return this;
60 }
61
62 @Override
63 public AbstractResponseBuilder<T> setHeaders(final Header... headers) {
64 super.setHeaders(headers);
65 return this;
66 }
67
68 @Override
69 public AbstractResponseBuilder<T> addHeader(final Header header) {
70 super.addHeader(header);
71 return this;
72 }
73
74 @Override
75 public AbstractResponseBuilder<T> addHeader(final String name, final String value) {
76 super.addHeader(name, value);
77 return this;
78 }
79
80 @Override
81 public AbstractResponseBuilder<T> removeHeader(final Header header) {
82 super.removeHeader(header);
83 return this;
84 }
85
86 @Override
87 public AbstractResponseBuilder<T> removeHeaders(final String name) {
88 super.removeHeaders(name);
89 return this;
90 }
91
92 @Override
93 public AbstractResponseBuilder<T> setHeader(final Header header) {
94 super.setHeader(header);
95 return this;
96 }
97
98 @Override
99 public AbstractResponseBuilder<T> setHeader(final String name, final String value) {
100 super.setHeader(name, value);
101 return this;
102 }
103
104 protected abstract T build();
105
106 }