|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.stackmob.sdk.api.StackMobOptions
public class StackMobOptions
Stores the various options that can be passed into a request. Calls can be chained for ease of use
StackMobOptions.https(true).withSelectedFields(Arrays.asList("name", "age").withDepthOf(2)
Be careful not to call the static methods, which create new options, from non-static context. Java
allows this for no good reason with a warning. The object methods are all prefixed with "with".
The following code would not do what you want:
// This is wrong! You'll only get the depthOf in the resulting options
StackMobOptions.https(true).selectedFields(Arrays.asList("name", "age").depthOf(2)
| Constructor Summary | |
|---|---|
StackMobOptions()
|
|
| Method Summary | |
|---|---|
static StackMobOptions |
depthOf(int depth)
set the expand depth of objects being returned. |
int |
getExpandDepth()
get the expand depth as set by withDepthOf(Integer) |
List<Map.Entry<String,String>> |
getHeaders()
The headers specified in these options. |
List<String> |
getSelection()
get the list of selected fields as specified by selectedFields(java.util.List)
or withSelectedFields(java.util.List), or null if none specified (meaning all fields
are selected). |
static StackMobOptions |
header(String name,
String value)
add a single header to a request |
static StackMobOptions |
headers(List<Map.Entry<String,String>> headers)
add a list of headers to a request |
static StackMobOptions |
headers(Map<String,String> headerMap)
add a set of headers to a request |
static StackMobOptions |
https(boolean https)
Force a method to be either http or https, overriding any defaults |
boolean |
isHTTPS()
whether or not to use https |
static StackMobOptions |
none()
empty options that do nothing |
static StackMobOptions |
selectedFields(List<String> fields)
restricts the fields returned by a request. |
StackMobOptions |
suggestHTTPS(boolean https)
Force a method to be either http or https, overriding any defaults, unless https has already been set |
StackMobOptions |
withDepthOf(Integer i)
set the expand depth of objects being returned. |
StackMobOptions |
withHeader(String name,
String value)
add a single header to a request |
StackMobOptions |
withHeaders(List<Map.Entry<String,String>> headers)
add a list of headers to a request |
StackMobOptions |
withHeaders(Map<String,String> headerMap)
add a set of headers to a request |
StackMobOptions |
withHTTPS(boolean https)
Force a method to be either http or https, overriding any defaults or previous settings |
StackMobOptions |
withSelectedFields(List<String> fields)
restricts the fields returned by a request. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StackMobOptions()
| Method Detail |
|---|
public static StackMobOptions none()
public static StackMobOptions https(boolean https)
https - if true, use https, otherwise http
public static StackMobOptions header(String name,
String value)
name - the header namevalue - the value of the header
public static StackMobOptions headers(Map<String,String> headerMap)
headerMap - the headers to add
public static StackMobOptions headers(List<Map.Entry<String,String>> headers)
headers - the headers to add
public static StackMobOptions selectedFields(List<String> fields)
fields - the fields to return
public static StackMobOptions depthOf(int depth)
depth - the expand depth, maximum is 3
public StackMobOptions withHTTPS(boolean https)
https - if true, use https, otherwise http
public StackMobOptions suggestHTTPS(boolean https)
https - if true, use https, otherwise http
public StackMobOptions withHeader(String name,
String value)
name - the header namevalue - the value of the header
public StackMobOptions withHeaders(Map<String,String> headerMap)
headerMap - the headers to add
public StackMobOptions withHeaders(List<Map.Entry<String,String>> headers)
headers - the headers to add
public StackMobOptions withSelectedFields(List<String> fields)
fields - the fields to return
public StackMobOptions withDepthOf(Integer i)
i - the expand depth, maximum is 3
public boolean isHTTPS()
public List<Map.Entry<String,String>> getHeaders()
public int getExpandDepth()
withDepthOf(Integer)
public List<String> getSelection()
selectedFields(java.util.List)
or withSelectedFields(java.util.List), or null if none specified (meaning all fields
are selected).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||