add api() method to service builder

This commit is contained in:
dustin norlander authored and Pablo Fernandez committed 2011-01-26 10:27:35 -03:00
1 parent da3a3f4a0d
commit 0f39d37ddc
2 files changed
+20

No files matched your search

+5
View File
@@ -24,3 +24,8 @@
* FEATURE: OAuth 2.0 Support and Facebook support out of the box (thanks Diego Silveira)
* REFACTOR: Api creation and OAuthService refactors
* REFACTOR: Connections are created lazily (just before sending the request)
[1.1.1]
* FIX: Removed isEmpty() from OAuth2.0 code in order to support older JVMs
* FEATURE: Overloaded provider() method to support instances as well as classes (thanks dustismo)
@@ -56,6 +56,21 @@ public class ServiceBuilder
return api;
}
/**
* Configures the {@link Api}
*
* Overloaded version. Let's you use an instance instead of a class.
*
* @param api instance of {@link Api}s
* @return the {@link ServiceBuilder} instance for method chaining
*/
public ServiceBuilder provider(Api api)
{
Preconditions.checkNotNull(api, "Api cannot be null");
this.api = api;
return this;
}
/**
* Adds an OAuth callback url
*