-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathRequestBase.java
More file actions
48 lines (36 loc) · 1.03 KB
/
RequestBase.java
File metadata and controls
48 lines (36 loc) · 1.03 KB
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
/*
* Copyright (c) 2011 chargebee.com
* All Rights Reserved.
*/
package com.chargebee.internal;
import java.util.*;
import static com.chargebee.IdempotencyConstants.IDEMPOTENCY_HEADER;
public class RequestBase<U extends RequestBase> {
protected String uri;
protected Params params = new Params();
protected ParamsV2 paramsV2 = new ParamsV2();
protected Map<String,String> headers = new HashMap();
protected String subDomain;
protected boolean isJsonRequest;
protected boolean isIdempotent;
public U setIdempotencyKey(String idempotencyKey){
headers.put(IDEMPOTENCY_HEADER, idempotencyKey);
return (U)this;
}
public Params params() {
return params;
}
public ParamsV2 paramsV2() {
return paramsV2;
}
public U header(String headerName,String headerValue){
headers.put(headerName, headerValue);
return (U)this;
}
public String uri() {
return uri;
}
public Map<String, String> headers() {
return headers;
}
}