Class OfflineDownloadOptions

  • All Implemented Interfaces:
    android.os.Parcelable

    public abstract class OfflineDownloadOptions
    extends java.lang.Object
    implements android.os.Parcelable
    This model class wraps the offline region definition with notifications options and the offline region metadata. It is a companion object to OfflineRegion with regionId and OfflineDownloadService with serviceId.
    Since:
    0.1.0
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  OfflineDownloadOptions.Builder
      The Builder class in charge of constructing this class and setting the values accordingly.
      • Nested classes/interfaces inherited from interface android.os.Parcelable

        android.os.Parcelable.ClassLoaderCreator<T extends java.lang.Object>, android.os.Parcelable.Creator<T extends java.lang.Object>
    • Field Summary

      • Fields inherited from interface android.os.Parcelable

        CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      static OfflineDownloadOptions.Builder builder()
      Used to build a new instance of this class.
      abstract com.mapbox.mapboxsdk.offline.OfflineRegionDefinition definition()
      The download definition which is used to actually launch the download inside the service.
      abstract byte[] metadata()
      Metadata can optionally be added to your offline download region which can contain any additional information you desire.
      abstract NotificationOptions notificationOptions()
      Launching the service requires a notification, using the NotificationOptions class allows you to customize this notification and will be displayed for the offline download region while the service is running in the background.
      abstract int progress()
      Current download progress for this specific offline region.
      abstract 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.Builder toBuilder()
      A convenient way to build a new instance of this class using all of the same values this current instance has.
      abstract java.lang.Long uuid()
      A region id which the service provides so internally identifying a particular region is easier during the download session.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface android.os.Parcelable

        describeContents, writeToParcel
    • Constructor Detail

      • OfflineDownloadOptions

        public OfflineDownloadOptions()
    • Method Detail

      • definition

        @NonNull
        public abstract 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.
        Returns:
        the Map SDK Offline region definition which can be used to acquire region download definition information
        Since:
        0.1.0
      • notificationOptions

        public abstract NotificationOptions notificationOptions()
        Launching the service requires a notification, using the NotificationOptions class allows you to customize this notification and will be displayed for the offline download region while the service is running in the background.
        Returns:
        the NotificationOptions which will be used during the download process
        Since:
        0.1.0
      • regionName

        @Nullable
        public abstract 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.
        Returns:
        the string which represents this offline regions name
        Since:
        0.1.0
      • metadata

        public abstract byte[] metadata()
        Metadata can optionally be added to your offline download region which can contain any additional information you desire.
        Returns:
        a byte array representing the optional metadata
        Since:
        0.1.0
      • progress

        public abstract 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.
        Returns:
        an integer value between 0 and 100 representing the download progress
        Since:
        0.1.0
      • uuid

        @NonNull
        public abstract java.lang.Long uuid()
        A region id which the service provides so internally identifying a particular region is easier during the download session. You'll rarely, if ever, need to use this information.
        Returns:
        a long, unique, identifier for this offline download region
        Since:
        0.1.0
      • builder

        public static OfflineDownloadOptions.Builder builder()
        Used to build a new instance of this class.
        Returns:
        this classes builder class
        Since:
        0.1.0
      • toBuilder

        public abstract OfflineDownloadOptions.Builder toBuilder()
        A convenient way to build a new instance of this class using all of the same values this current instance has. Use this when you wish to modify a single entry.
        Returns:
        a new OfflineDownloadOptions.Builder instance with all the same values this classes instance contains
        Since:
        0.1.0