diff --git a/changelog.txt b/changelog.txt index 2ddc512..7e83774 100644 --- a/changelog.txt +++ b/changelog.txt @@ -23,4 +23,9 @@ * 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) \ No newline at end of file + * 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) \ No newline at end of file diff --git a/src/main/java/org/scribe/builder/ServiceBuilder.java b/src/main/java/org/scribe/builder/ServiceBuilder.java index 59a6d12..9236ddf 100644 --- a/src/main/java/org/scribe/builder/ServiceBuilder.java +++ b/src/main/java/org/scribe/builder/ServiceBuilder.java @@ -55,7 +55,22 @@ 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 *