Class OfflineDownloadOptions.Builder
- java.lang.Object
-
- com.mapbox.mapboxsdk.plugins.offline.model.OfflineDownloadOptions.Builder
-
- Enclosing class:
- OfflineDownloadOptions
public abstract static class OfflineDownloadOptions.Builder extends java.lang.ObjectThe Builder class in charge of constructing this class and setting the values accordingly.- Since:
- 0.1.0
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract OfflineDownloadOptionsbuild()Build a newOfflineDownloadOptionsinstance using the information and values provided inside this builder classabstract OfflineDownloadOptions.Builderdefinition(com.mapbox.mapboxsdk.offline.OfflineRegionDefinition definition)The download definition which is used to actually launch the download inside the service.abstract OfflineDownloadOptions.Buildermetadata(byte[] metadata)Metadata can optionally be added to your offline download region which can contain any additional information you desire.abstract OfflineDownloadOptions.BuildernotificationOptions(NotificationOptions notificationOptions)Launching the service requires a notification, using theNotificationOptionsclass allows you to customize this notification and will be displayed for the offline download region while the service is running in the background.abstract OfflineDownloadOptions.Builderprogress(int progress)Current download progress for this specific offline region.abstract OfflineDownloadOptions.BuilderregionName(java.lang.String regionName)A convenient method for providing the offline region a name which can then be used later to identify the specific region in the database of offline region tiles.abstract OfflineDownloadOptions.Builderuuid(java.lang.Long uuid)Internal usage only
-
-
-
Method Detail
-
uuid
public abstract OfflineDownloadOptions.Builder uuid(@NonNull java.lang.Long uuid)
Internal usage onlyA region id which the service provides so internally identifying a particular region is easier during the download session.
- Parameters:
uuid- a long, unique, identifier for this offline download region provided by the download service.- Returns:
- this builder for chaining options together
- Since:
- 0.1.0
-
progress
public abstract OfflineDownloadOptions.Builder progress(int progress)
Current download progress for this specific offline region. This will be 0 until the download actually starts and will be a value between 0 and 100 once the download begins.OfflinePlugin.onProgressChanged(OfflineDownloadOptions, int)should be used during the download session to get progress updates.- Parameters:
progress- an integer value between 0 and 100 representing the download progress- Returns:
- this builder for chaining options together
- Since:
- 0.1.0
-
definition
public abstract OfflineDownloadOptions.Builder definition(@NonNull com.mapbox.mapboxsdk.offline.OfflineRegionDefinition definition)
The download definition which is used to actually launch the download inside the service. This object particularly contains information such as the region bounding box, zoom levels, pixel density, etc.- Parameters:
definition- the Map SDK Offline region definition which can be used to acquire region download definition information- Returns:
- this builder for chaining options together
- Since:
- 0.1.0
-
notificationOptions
public abstract OfflineDownloadOptions.Builder notificationOptions(NotificationOptions notificationOptions)
Launching the service requires a notification, using theNotificationOptionsclass allows you to customize this notification and will be displayed for the offline download region while the service is running in the background.- Parameters:
notificationOptions- theNotificationOptionswhich will be used during the download process- Returns:
- this builder for chaining options together
- Since:
- 0.1.0
-
regionName
public abstract OfflineDownloadOptions.Builder regionName(@Nullable java.lang.String regionName)
A convenient method for providing the offline region a name which can then be used later to identify the specific region in the database of offline region tiles.- Parameters:
regionName- the string which represents this offline regions name- Returns:
- this builder for chaining options together
- Since:
- 0.1.0
-
metadata
public abstract OfflineDownloadOptions.Builder metadata(@NonNull byte[] metadata)
Metadata can optionally be added to your offline download region which can contain any additional information you desire.- Parameters:
metadata- a byte array representing the optional metadata- Returns:
- this builder for chaining options together
- Since:
- 0.1.0
-
build
public abstract OfflineDownloadOptions build()
Build a newOfflineDownloadOptionsinstance using the information and values provided inside this builder class- Returns:
- a new instance of the
OfflineDownloadOptionswhich is using the values you provided in this builder - Since:
- 0.1.0
-
-