Class UrlBuilder
- java.lang.Object
-
- com.aerisweather.aeris.communication.UrlBuilder
-
- Direct Known Subclasses:
AerisRequest
public abstract class UrlBuilder extends Object
Abstract UrlBuilder that takes care of some handling for each builder.
-
-
Field Summary
Fields Modifier and Type Field Description protected String
clientId
Client Id variable needed for the urlprotected String
clientSecret
Client secret key needed for the urlprotected String
packageName
Pacakage name of the app
-
Constructor Summary
Constructors Constructor Description UrlBuilder()
Main constructor that takes the context to grab R.string variables.UrlBuilder(String clientId, String clientSecret, String packageName)
Another constructor to pass in the client id and client secret without using the R.string
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract String
build()
Builds the full url of the request.protected String
getLimit(int limit)
String
getOAuth()
Appends the OAuth keys to the Url.protected String
getPositionString(double lat, double lon)
Get the position string for appending to the url.
-
-
-
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
- doublelon
- 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.
-
-