Package io.appbase.requestbuilders
Class AppbaseRequestBuilder
- java.lang.Object
-
- io.appbase.requestbuilders.AppbaseRequestBuilder
-
public class AppbaseRequestBuilder extends Object
-
-
Constructor Summary
Constructors Constructor Description AppbaseRequestBuilder(AppbaseClient a, String type, String id, int method)
-
Method Summary
-
-
-
Field Detail
-
Index
public static final int Index
- See Also:
- Constant Field Values
-
Update
public static final int Update
- See Also:
- Constant Field Values
-
Delete
public static final int Delete
- See Also:
- Constant Field Values
-
Rest
public static final int Rest
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AppbaseRequestBuilder
public AppbaseRequestBuilder(AppbaseClient a, String type, String id, int method)
-
-
Method Detail
-
addHeader
public AppbaseRequestBuilder addHeader(String name, String value)
- Parameters:
name- KeyStringvalue- ValueString- Returns:
- The modified
AppbaseRequestBuilder.
-
build
public okhttp3.Request build()
- Returns:
- Builds the request according to the current state of the request builder.
-
cacheControl
public AppbaseRequestBuilder cacheControl(okhttp3.CacheControl cacheControl)
SeeCacheControl
-
delete
public AppbaseRequestBuilder delete()
Set method type to delete- Returns:
- The modified
AppbaseRequestBuilder.
-
delete
public AppbaseRequestBuilder delete(String body)
Sets method type to delete and add the body.- Parameters:
body- Set the body of the request.- Returns:
- The modified
AppbaseRequestBuilder.
-
equals
public boolean equals(Object obj)
Checks if builder equals the obj.
-
get
public AppbaseRequestBuilder get()
Sets method type to get.- Returns:
- The modified
AppbaseRequestBuilder.
-
head
public AppbaseRequestBuilder head()
- Returns:
- The modified
AppbaseRequestBuilder.
-
header
public AppbaseRequestBuilder header(String name, String value)
Adds header with the key and value.
-
headers
public AppbaseRequestBuilder headers(okhttp3.Headers headers)
AddsHeaders- Parameters:
headers-- Returns:
- The modified
AppbaseRequestBuilder.
-
method
public AppbaseRequestBuilder method(String method, String body)
Sets method and body.- Parameters:
method- The method of request.body- The body of the request.- Returns:
- The modified
AppbaseRequestBuilder.
-
patch
public AppbaseRequestBuilder patch(String body)
-
post
public AppbaseRequestBuilder post(String body)
Sets method to post and adds the body.- Parameters:
body- The request body.- Returns:
- The modified
AppbaseRequestBuilder.
-
put
public AppbaseRequestBuilder put(String body)
Sets method to put and adds the body.- Parameters:
body- The request body- Returns:
- The modified
AppbaseRequestBuilder.
-
removeHeader
public AppbaseRequestBuilder removeHeader(String name)
- Parameters:
name- removes the respective header.- Returns:
- The modified
AppbaseRequestBuilder.
-
tag
public AppbaseRequestBuilder tag(Object tag)
-
url
public AppbaseRequestBuilder url(okhttp3.HttpUrl url)
- Parameters:
url- The URL which need to be set- Returns:
- The modified
AppbaseRequestBuilder.
-
url
public AppbaseRequestBuilder url(String url)
- Parameters:
url- The URL which need to be set- Returns:
- The modified
AppbaseRequestBuilder.
-
url
public AppbaseRequestBuilder url(URL url)
- Parameters:
url- The URL which need to be set- Returns:
- The modified
AppbaseRequestBuilder.
-
addQueryParams
public AppbaseRequestBuilder addQueryParams(List<Param> parameters)
- Returns:
- The modified
AppbaseRequestBuilder.
-
addQueryParam
public AppbaseRequestBuilder addQueryParam(String key, String value)
- Parameters:
key- The key of the key value pair of query parameter to be added.value- The value of the key value pair of query parameter to be added.- Returns:
- The modified
AppbaseRequestBuilder.
-
execute
public okhttp3.Response execute()
- Returns:
- The
Responseof the Request is returned.
-
-