Package com.geouniq.android
Class GeoUniq.CustomEndpoint.Builder
java.lang.Object
com.geouniq.android.GeoUniq.CustomEndpoint.Builder
- Enclosing class:
- GeoUniq.CustomEndpoint
Builder class to obtain
GeoUniq.CustomEndpoint objects-
Constructor Summary
ConstructorsConstructorDescriptionBuilder()Builder(GeoUniq.CustomEndpoint endpoint) Returns aBuilderalready configured with all the settings of the providedCustomEndpoint -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates aGeoUniq.CustomEndpointwith the parameters supplied to thisBuilder.
Calling this method does not set theCustomEndpoint.Removes all of HTTP Header for theGeoUniq.CustomEndpoint.Removes all the Query-String parameters forGeoUniq.CustomEndpoint.Removes custom data for theGeoUniq.CustomEndpoint.removeHeader(String key) Removes an HTTP Header for theGeoUniq.CustomEndpoint.Removes a Query-String parameter.setCustomData(org.json.JSONObject data) Sets a JSON object to be added to all location updates sent to theGeoUniq.CustomEndpoint.setEnabled(boolean value) Sets whether the custom endpoint must be enabled or not.Configures an HTTP Header for theGeoUniq.CustomEndpoint.setHeaders(Map<String, String> headers) Sets a set of HTTP Header for theGeoUniq.CustomEndpoint.setQueryStringParameter(String key, String value) Configures a Query-String parameter to be added to the URL.setQueryStringParameters(Map<String, String> parameters) Sets a set of Query-String parameters for theGeoUniq.CustomEndpoint.Sets the URL where location updates have to be sent.
-
Constructor Details
-
Builder
public Builder() -
Builder
Returns aBuilderalready configured with all the settings of the providedCustomEndpoint- Parameters:
endpoint- aCustomEndpointfrom which all setting must be copied into thisBuilder
-
-
Method Details
-
setUrl
public GeoUniq.CustomEndpoint.Builder setUrl(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:
-
setEnabled
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:
-
setHeader
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:
-
removeHeader
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:
-
setHeaders
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:
-
removeAllHeaders
Removes all of HTTP Header for theGeoUniq.CustomEndpoint.- Returns:
- This
Builderobject to allow for chaining of calls to set methods - See Also:
-
setQueryStringParameter
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:
-
removeQueryStringParameter
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:
-
setQueryStringParameters
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:
-
removeAllQueryStringParameters
Removes all the Query-String parameters forGeoUniq.CustomEndpoint.- Returns:
- This
Builderobject to allow for chaining of calls to set methods - See Also:
-
setCustomData
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:
-
removeCustomData
Removes custom data for theGeoUniq.CustomEndpoint.- Returns:
- This
Builderobject to allow for chaining of calls to set methods - See Also:
-
build
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))
-