Package com.geouniq.android
Class GeoUniq.CustomEndpoint.Builder
- java.lang.Object
-
- com.geouniq.android.GeoUniq.CustomEndpoint.Builder
-
- Enclosing class:
- GeoUniq.CustomEndpoint
public static class GeoUniq.CustomEndpoint.Builder extends java.lang.ObjectBuilder class to obtainGeoUniq.CustomEndpointobjects
-
-
Constructor Summary
Constructors Constructor Description Builder()Builder(GeoUniq.CustomEndpoint endpoint)Returns aBuilderalready configured with all the settings of the providedCustomEndpoint
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeoUniq.CustomEndpointbuild()Creates aGeoUniq.CustomEndpointwith the parameters supplied to thisBuilder.
Calling this method does not set theCustomEndpoint.GeoUniq.CustomEndpoint.BuilderremoveAllHeaders()Removes all of HTTP Header for theGeoUniq.CustomEndpoint.GeoUniq.CustomEndpoint.BuilderremoveAllQueryStringParameters()Removes all the Query-String parameters forGeoUniq.CustomEndpoint.GeoUniq.CustomEndpoint.BuilderremoveCustomData()Removes custom data for theGeoUniq.CustomEndpoint.GeoUniq.CustomEndpoint.BuilderremoveHeader(java.lang.String key)Removes an HTTP Header for theGeoUniq.CustomEndpoint.GeoUniq.CustomEndpoint.BuilderremoveQueryStringParameter(java.lang.String key)Removes a Query-String parameter.GeoUniq.CustomEndpoint.BuildersetCustomData(org.json.JSONObject data)Sets a JSON object to be added to all location updates sent to theGeoUniq.CustomEndpoint.GeoUniq.CustomEndpoint.BuildersetEnabled(boolean value)Sets whether the custom endpoint must be enabled or not.GeoUniq.CustomEndpoint.BuildersetHeader(java.lang.String key, java.lang.String value)Configures an HTTP Header for theGeoUniq.CustomEndpoint.GeoUniq.CustomEndpoint.BuildersetHeaders(java.util.Map<java.lang.String,java.lang.String> headers)Sets a set of HTTP Header for theGeoUniq.CustomEndpoint.GeoUniq.CustomEndpoint.BuildersetQueryStringParameter(java.lang.String key, java.lang.String value)Configures a Query-String parameter to be added to the URL.GeoUniq.CustomEndpoint.BuildersetQueryStringParameters(java.util.Map<java.lang.String,java.lang.String> parameters)Sets a set of Query-String parameters for theGeoUniq.CustomEndpoint.GeoUniq.CustomEndpoint.BuildersetUrl(java.lang.String url)Sets the URL where location updates have to be sent.
-
-
-
Constructor Detail
-
Builder
public Builder()
-
Builder
public Builder(GeoUniq.CustomEndpoint endpoint)
Returns aBuilderalready configured with all the settings of the providedCustomEndpoint- Parameters:
endpoint- aCustomEndpointfrom which all setting must be copied into thisBuilder
-
-
Method Detail
-
setUrl
public GeoUniq.CustomEndpoint.Builder setUrl(java.lang.String url) throws GeoUniq.CustomEndpoint.InvalidUrlException
Sets the URL where location updates have to be sent.- Parameters:
url- The URL- Returns:
- This
Builderobject to allow for chaining of calls to set methods - Throws:
GeoUniq.CustomEndpoint.InvalidUrlException- ifurldoes not represent a valid HTTP URL- See Also:
GeoUniq.setCustomEndpoint(CustomEndpoint)
-
setEnabled
public GeoUniq.CustomEndpoint.Builder setEnabled(boolean value)
Sets whether the custom endpoint must be enabled or not. By default, it will be disabled.- Parameters:
value- Iftruethe custom endpoint is set as enabled.- Returns:
- This
Builderobject to allow for chaining of calls to set methods - See Also:
GeoUniq.setCustomEndpoint(CustomEndpoint)
-
setHeader
public GeoUniq.CustomEndpoint.Builder setHeader(java.lang.String key, java.lang.String value)
Configures an HTTP Header for theGeoUniq.CustomEndpoint.- Parameters:
key- The HTTP header keyvalue- The HTTP header value- Returns:
- This
Builderobject to allow for chaining of calls to set methods - See Also:
GeoUniq.setCustomEndpoint(CustomEndpoint)
-
removeHeader
public GeoUniq.CustomEndpoint.Builder removeHeader(java.lang.String key)
Removes an HTTP Header for theGeoUniq.CustomEndpoint.- Parameters:
key- The HTTP header key- Returns:
- This
Builderobject to allow for chaining of calls to set methods - See Also:
GeoUniq.setCustomEndpoint(CustomEndpoint)
-
setHeaders
public GeoUniq.CustomEndpoint.Builder setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)
Sets a set of HTTP Header for theGeoUniq.CustomEndpoint.- Parameters:
headers- aMapwhose entries represent a single HTTP header- Returns:
- This
Builderobject to allow for chaining of calls to set methods - See Also:
GeoUniq.setCustomEndpoint(CustomEndpoint)
-
removeAllHeaders
public GeoUniq.CustomEndpoint.Builder removeAllHeaders()
Removes all of HTTP Header for theGeoUniq.CustomEndpoint.- Returns:
- This
Builderobject to allow for chaining of calls to set methods - See Also:
GeoUniq.setCustomEndpoint(CustomEndpoint)
-
setQueryStringParameter
public GeoUniq.CustomEndpoint.Builder setQueryStringParameter(java.lang.String key, java.lang.String value)
Configures a Query-String parameter to be added to the URL.- Parameters:
key- The key of the parametervalue- The value of the parameter- Returns:
- This
Builderobject to allow for chaining of calls to set methods - See Also:
GeoUniq.setCustomEndpoint(CustomEndpoint)
-
removeQueryStringParameter
public GeoUniq.CustomEndpoint.Builder removeQueryStringParameter(java.lang.String key)
Removes a Query-String parameter.- Parameters:
key- The key of the parameter to remove- Returns:
- This
Builderobject to allow for chaining of calls to set methods - See Also:
GeoUniq.setCustomEndpoint(CustomEndpoint)
-
setQueryStringParameters
public GeoUniq.CustomEndpoint.Builder setQueryStringParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
Sets a set of Query-String parameters for theGeoUniq.CustomEndpoint.- Parameters:
parameters- aMapwhose entries represent a single Query-String parameter- Returns:
- This
Builderobject to allow for chaining of calls to set methods - See Also:
GeoUniq.setCustomEndpoint(CustomEndpoint)
-
removeAllQueryStringParameters
public GeoUniq.CustomEndpoint.Builder removeAllQueryStringParameters()
Removes all the Query-String parameters forGeoUniq.CustomEndpoint.- Returns:
- This
Builderobject to allow for chaining of calls to set methods - See Also:
GeoUniq.setCustomEndpoint(CustomEndpoint)
-
setCustomData
public GeoUniq.CustomEndpoint.Builder setCustomData(org.json.JSONObject data)
Sets a JSON object to be added to all location updates sent to theGeoUniq.CustomEndpoint.- Parameters:
data- the custom data to be added- Returns:
- This
Builderobject to allow for chaining of calls to set methods - See Also:
GeoUniq.setCustomEndpoint(CustomEndpoint)
-
removeCustomData
public GeoUniq.CustomEndpoint.Builder removeCustomData()
Removes custom data for theGeoUniq.CustomEndpoint.- Returns:
- This
Builderobject to allow for chaining of calls to set methods - See Also:
GeoUniq.setCustomEndpoint(CustomEndpoint)
-
build
public GeoUniq.CustomEndpoint build() throws GeoUniq.CustomEndpoint.NoUrlDefinedException
Creates aGeoUniq.CustomEndpointwith the parameters supplied to thisBuilder.
Calling this method does not set theCustomEndpoint.GeoUniq.setCustomEndpoint(CustomEndpoint)(GeoFence)} must be called to set the createdCustomEndpoint.- Returns:
- The
CustomEndpoint - Throws:
GeoUniq.CustomEndpoint.NoUrlDefinedException- if no URL has been set (@seesetUrl(String))
-
-