@@ -52,7 +52,8 @@ public class AsyncHttpClient implements AsyncHttpClientInterface {
52
52
private Class <? extends AsyncHttpRequestInterface > requestClass ;
53
53
54
54
/**
55
- * Retrieves static instance of AsyncHttpClientInterface, if not yet configured, will configure it with default values
55
+ * Retrieves static instance of AsyncHttpClientInterface,
56
+ * if not yet configured, will configure it with default values
56
57
*
57
58
* @see com.loopj.android.http.interfaces.AsyncHttpClientOptionsInterface
58
59
* @see com.loopj.android.http.impl.AsyncHttpClientOptions
@@ -61,6 +62,12 @@ public static AsyncHttpClientInterface getDefaultInstance() {
61
62
return getDefaultInstance (new AsyncHttpClientOptions ());
62
63
}
63
64
65
+ /**
66
+ * Retrieves static instance of AsyncHttpClientInterface,
67
+ * if not yet configured, will configure it with provided options
68
+ *
69
+ * @see com.loopj.android.http.interfaces.AsyncHttpClientOptionsInterface
70
+ */
64
71
public static AsyncHttpClientInterface getDefaultInstance (AsyncHttpClientOptionsInterface options ) {
65
72
if (DEFAULT_INSTANCE == null ) {
66
73
synchronized (AsyncHttpClient .class ) {
@@ -72,7 +79,18 @@ public static AsyncHttpClientInterface getDefaultInstance(AsyncHttpClientOptions
72
79
return DEFAULT_INSTANCE ;
73
80
}
74
81
82
+ /**
83
+ * Default constructor, will configure AsyncHttpClientInterface
84
+ * instance with provided options, or with default options,
85
+ * if provided options argument is null
86
+ *
87
+ * @see com.loopj.android.http.interfaces.AsyncHttpClientOptionsInterface
88
+ * @see com.loopj.android.http.impl.AsyncHttpClientOptions
89
+ */
75
90
public AsyncHttpClient (AsyncHttpClientOptionsInterface options ) {
91
+ if (options == null ) {
92
+ options = new AsyncHttpClientOptions ();
93
+ }
76
94
httpClient = options .getHttpClient ();
77
95
defaultRequestOptions = options .getDefaultRequestOptions ();
78
96
threadPool = options .getThreadPool ();
0 commit comments