Class ServiceBuilder


  • public class ServiceBuilder
    extends Object
    Implementation of the Builder pattern, with a fluent interface that creates a OAuthService
    • Constructor Detail

      • ServiceBuilder

        public ServiceBuilder()
        Default constructor
    • Method Detail

      • provider

        public ServiceBuilder provider​(Class<? extends Api> apiClass)
        Configures the Api
        Parameters:
        apiClass - the class of one of the existent Apis on org.scribe.api package
        Returns:
        the ServiceBuilder instance for method chaining
      • provider

        public ServiceBuilder provider​(Api api)
        Configures the Api Overloaded version. Let's you use an instance instead of a class.
        Parameters:
        api - instance of Apis
        Returns:
        the ServiceBuilder instance for method chaining
      • callback

        public ServiceBuilder callback​(String callback)
        Adds an OAuth callback url
        Parameters:
        callback - callback url. Must be a valid url or 'oob' for out of band OAuth
        Returns:
        the ServiceBuilder instance for method chaining
      • apiKey

        public ServiceBuilder apiKey​(String apiKey)
        Configures the api key
        Parameters:
        apiKey - The api key for your application
        Returns:
        the ServiceBuilder instance for method chaining
      • apiSecret

        public ServiceBuilder apiSecret​(String apiSecret)
        Configures the api secret
        Parameters:
        apiSecret - The api secret for your application
        Returns:
        the ServiceBuilder instance for method chaining
      • scope

        public ServiceBuilder scope​(String scope)
        Configures the OAuth scope. This is only necessary in some APIs (like Google's).
        Parameters:
        scope - The OAuth scope
        Returns:
        the ServiceBuilder instance for method chaining
      • signatureType

        public ServiceBuilder signatureType​(SignatureType type)
        Configures the signature type, choose between header, querystring, etc. Defaults to Header
        Parameters:
        scope - The OAuth scope
        Returns:
        the ServiceBuilder instance for method chaining