Class A3LCurrentLocationRequest.Builder
- java.lang.Object
-
- com.amazon.A3L.location.A3LCurrentLocationRequest.Builder
-
- Enclosing class:
- A3LCurrentLocationRequest
public static final class A3LCurrentLocationRequest.Builder extends java.lang.Object
A builder forA3LCurrentLocationRequest
.
-
-
Constructor Summary
Constructors Constructor Description Builder()
Constructs a new builder with default values.Builder(A3LCurrentLocationRequest request)
Constructs a new builder with values copied from the givenA3LCurrentLocationRequest
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description A3LCurrentLocationRequest
build()
Builds a newA3LCurrentLocationRequest
.A3LCurrentLocationRequest.Builder
setDurationMillis(long durationMillis)
Sets the duration in milliseconds of the location request used to derive the current location if no historical location satisfies the current location request.A3LCurrentLocationRequest.Builder
setGranularity(int granularity)
Sets the Granularity of locations returned for this request.A3LCurrentLocationRequest.Builder
setMaxUpdateAgeMillis(long maxUpdateAgeMillis)
Sets the maximum age of any location returned for this request.A3LCurrentLocationRequest.Builder
setPriority(int priority)
Sets the Priority of the location request used to derive the current location if no historical location satisfies the current location request.
-
-
-
Constructor Detail
-
Builder
public Builder()
Constructs a new builder with default values.
-
Builder
public Builder(@NonNull A3LCurrentLocationRequest request)
Constructs a new builder with values copied from the givenA3LCurrentLocationRequest
- Parameters:
request
- :A3LCurrentLocationRequest
object to copy values.
-
-
Method Detail
-
setDurationMillis
@NonNull public A3LCurrentLocationRequest.Builder setDurationMillis(long durationMillis)
Sets the duration in milliseconds of the location request used to derive the current location if no historical location satisfies the current location request. If this duration expires with no location, the current location request will return a null location. The current location request may fail and return a null location after a shorter duration, but never a longer duration.NOTE: Internally, this duration may be capped with what the Fused Location Provider believes is a reasonable maximum duration until it is unlikely that any current location can be derived. This value is usually around roughly 30 seconds.
The default value is Long.MAX_VALUE.
- Parameters:
durationMillis
- : Duration in milliseconds of the location request used to derive the current location- Returns:
A3LCurrentLocationRequest.Builder
-
setGranularity
@NonNull public A3LCurrentLocationRequest.Builder setGranularity(int granularity)
Sets the Granularity of locations returned for this request. This controls whether fine or coarse locations may be returned. The default value is A3LGranularity.GRANULARITY_PERMISSION_LEVEL.- Parameters:
granularity
- : Granularity of locations to be returned for this request.- Returns:
A3LCurrentLocationRequest.Builder
-
setMaxUpdateAgeMillis
@NonNull public A3LCurrentLocationRequest.Builder setMaxUpdateAgeMillis(long maxUpdateAgeMillis)
Sets the maximum age of any location returned for this request. A value of 0 indicates that only freshly derived locations will be returned, and no historical locations will ever be returned. A value Long.MAX_VALUE represents an effectively unbounded maximum age.NOTE: This parameter applies only to historical locations. Freshly derived locations should almost always have timestamps close to the present time - however it is possible under unlikely conditions for location derivation to take longer than expected, in which case freshly derived locations may have slightly older timestamps.
The default value is 1 minute. Do not rely on the default value always being 1 minute as this may change without notice.
- Parameters:
maxUpdateAgeMillis
- : Maximum age of any location to be returned for this request.- Returns:
A3LCurrentLocationRequest.Builder
-
setPriority
@NonNull public A3LCurrentLocationRequest.Builder setPriority(int priority)
Sets the Priority of the location request used to derive the current location if no historical location satisfies the current location request.The default value is Priority.PRIORITY_BALANCED_POWER_ACCURACY
- Parameters:
priority
- :A3LPriority
to be set for the current location request.- Returns:
A3LCurrentLocationRequest.Builder
-
build
@NonNull public A3LCurrentLocationRequest build()
Builds a newA3LCurrentLocationRequest
.- Returns:
A3LCurrentLocationRequest
-
-