File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed
src/main/java/org/scribe/builder Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 2323
2424 * FEATURE: OAuth 2.0 Support and Facebook support out of the box (thanks Diego Silveira)
2525 * REFACTOR: Api creation and OAuthService refactors
26- * REFACTOR: Connections are created lazily (just before sending the request)
26+ * REFACTOR: Connections are created lazily (just before sending the request)
27+
28+ [1.1.1]
29+
30+ * FIX: Removed isEmpty() from OAuth2.0 code in order to support older JVMs
31+ * FEATURE: Overloaded provider() method to support instances as well as classes (thanks dustismo)
Original file line number Diff line number Diff line change @@ -55,7 +55,22 @@ private Api createApi(Class<? extends Api> apiClass)
5555 }
5656 return api ;
5757 }
58-
58+
59+ /**
60+ * Configures the {@link Api}
61+ *
62+ * Overloaded version. Let's you use an instance instead of a class.
63+ *
64+ * @param api instance of {@link Api}s
65+ * @return the {@link ServiceBuilder} instance for method chaining
66+ */
67+ public ServiceBuilder provider (Api api )
68+ {
69+ Preconditions .checkNotNull (api , "Api cannot be null" );
70+ this .api = api ;
71+ return this ;
72+ }
73+
5974 /**
6075 * Adds an OAuth callback url
6176 *
You can’t perform that action at this time.
0 commit comments