Class UrlBuilder

  • Direct Known Subclasses:
    AerisRequest

    public abstract class UrlBuilder
    extends Object
    Abstract UrlBuilder that takes care of some handling for each builder.
    • Field Detail

      • clientId

        protected String clientId
        Client Id variable needed for the url
      • clientSecret

        protected String clientSecret
        Client secret key needed for the url
      • packageName

        protected String packageName
        Pacakage name of the app
    • Constructor Detail

      • UrlBuilder

        public UrlBuilder()
        Main constructor that takes the context to grab R.string variables.
      • UrlBuilder

        public UrlBuilder​(String clientId,
                          String clientSecret,
                          String packageName)
        Another constructor to pass in the client id and client secret without using the R.string
        Parameters:
        clientId - Aeris account id
        clientSecret - Aeris account secret
        packageName - Package name for app
    • Method Detail

      • getOAuth

        public String getOAuth()
        Appends the OAuth keys to the Url.
        Returns:
        oAuth key
      • getPositionString

        protected String getPositionString​(double lat,
                                           double lon)
        Get the position string for appending to the url.
        Parameters:
        lat - double
        lon - double
        Returns:
        String
      • getLimit

        protected String getLimit​(int limit)
      • build

        public abstract String build()
        Builds the full url of the request.
        Returns:
        the String url for the request.