Package com.indooratlas.android.sdk
Class IAGeofence.Builder
- java.lang.Object
-
- com.indooratlas.android.sdk.IAGeofence.Builder
-
- Enclosing interface:
- IAGeofence
public static class IAGeofence.Builder extends Object
Builder to configureIAGeofence
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Builder(IAGeofence geofence)
Builder pre-populated from givenIAGeofence
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IAGeofence
build()
Create aIAGeofence
from thisIAGeofence.Builder
.IAGeofence.Builder
withEdges(List<double[]> edges)
Configures the IAGeofence with the list of unique WGS84 (latitude, longitude) points.IAGeofence.Builder
withFloor(int floor)
Configure the IAGeofence with the givenfloor number
.IAGeofence.Builder
withId(String id)
Configure the IAGeofence with the givenidentification code
.IAGeofence.Builder
withName(String name)
IAGeofence.Builder
withPayload(JSONObject payload)
Configure the IAGeofence with the givenpayload
.
-
-
-
Constructor Detail
-
Builder
public Builder(IAGeofence geofence)
Builder pre-populated from givenIAGeofence
-
Builder
public Builder()
-
-
Method Detail
-
withEdges
public IAGeofence.Builder withEdges(List<double[]> edges)
Configures the IAGeofence with the list of unique WGS84 (latitude, longitude) points. List should include the WGS84 coordinates in a clockwise order. The unique coordinates are used internally to create a closed polygon.- See Also:
IAGeofence.getEdges()
-
withId
public IAGeofence.Builder withId(String id)
Configure the IAGeofence with the givenidentification code
.- See Also:
IAGeofence.getId()
-
withName
public IAGeofence.Builder withName(String name)
-
withPayload
public IAGeofence.Builder withPayload(JSONObject payload) throws IllegalArgumentException
Configure the IAGeofence with the givenpayload
. If this method is not called, the IAGeofence is constructed with empty JSONObject as the payload.- Throws:
IllegalArgumentException
- See Also:
IAGeofence.hasPayload()
,IAGeofence.getPayload()
-
withFloor
public IAGeofence.Builder withFloor(int floor)
Configure the IAGeofence with the givenfloor number
.- See Also:
IAGeofence.hasFloor()
,IAGeofence.getFloor()
-
build
public IAGeofence build()
Create aIAGeofence
from thisIAGeofence.Builder
.- Throws:
IllegalArgumentException
- If edges or id is not set
-
-