# Subscription

public class **Subscription** extends [Object](https://developer.android.com/reference/java/lang/Object.html)  
implements [Parcelable](https://developer.android.com/reference/android/os/Parcelable.html) Subscription for persistent storage of data from a given `https://developers.google.com/android/reference/com/google/android/gms/fitness/data/DataSource` or for a given `https://developers.google.com/android/reference/com/google/android/gms/fitness/data/DataType`.

### Inherited Constant Summary

From interface android.os.Parcelable

|---|---|---|
| int | CONTENTS_FILE_DESCRIPTOR |   |
| int | PARCELABLE_WRITE_RETURN_VALUE |   |

### Public Method Summary

|---|---|
| boolean | [equals](https://developers.google.com/android/reference/com/google/android/gms/fitness/data/Subscription#equals(java.lang.Object))([Object](https://developer.android.com/reference/java/lang/Object.html) other) |
| [DataSource](https://developers.google.com/android/reference/com/google/android/gms/fitness/data/DataSource) | [getDataSource](https://developers.google.com/android/reference/com/google/android/gms/fitness/data/Subscription#getDataSource())() Returns the data source for this subscription, if specified. |
| [DataType](https://developers.google.com/android/reference/com/google/android/gms/fitness/data/DataType) | [getDataType](https://developers.google.com/android/reference/com/google/android/gms/fitness/data/Subscription#getDataType())() Returns the data type for this subscription, if specified. |
| int | [hashCode](https://developers.google.com/android/reference/com/google/android/gms/fitness/data/Subscription#hashCode())() |
| [String](https://developer.android.com/reference/java/lang/String.html) | [toDebugString](https://developers.google.com/android/reference/com/google/android/gms/fitness/data/Subscription#toDebugString())() |
| [String](https://developer.android.com/reference/java/lang/String.html) | [toString](https://developers.google.com/android/reference/com/google/android/gms/fitness/data/Subscription#toString())() |
| void | [writeToParcel](https://developers.google.com/android/reference/com/google/android/gms/fitness/data/Subscription#writeToParcel(android.os.Parcel,%20int))([Parcel](https://developer.android.com/reference/android/os/Parcel.html) dest, int flags) |

### Inherited Method Summary

From class java.lang.Object

|---|---|
| [Object](https://developer.android.com/reference/java/lang/Object.html) | clone() |
| boolean | equals([Object](https://developer.android.com/reference/java/lang/Object.html) arg0) |
| void | finalize() |
| final [Class](https://developer.android.com/reference/java/lang/Class.html)\<?\> | getClass() |
| int | hashCode() |
| final void | notify() |
| final void | notifyAll() |
| [String](https://developer.android.com/reference/java/lang/String.html) | toString() |
| final void | wait(long arg0, int arg1) |
| final void | wait(long arg0) |
| final void | wait() |

From interface android.os.Parcelable

|---|---|
| abstract int | describeContents() |
| abstract void | writeToParcel([Parcel](https://developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |

## Public Methods

#### public boolean **equals** ([Object](https://developer.android.com/reference/java/lang/Object.html) other)

#### public [DataSource](https://developers.google.com/android/reference/com/google/android/gms/fitness/data/DataSource)
**getDataSource** ()

Returns the data source for this subscription, if specified.

##### Returns

- The specified data source, or `null` if none specified.

#### public [DataType](https://developers.google.com/android/reference/com/google/android/gms/fitness/data/DataType)
**getDataType** ()

Returns the data type for this subscription, if specified.

##### Returns

- The specified data type, or `null` if none specified.

#### public int **hashCode** ()

#### public [String](https://developer.android.com/reference/java/lang/String.html) **toDebugString** ()

#### public [String](https://developer.android.com/reference/java/lang/String.html) **toString** ()

#### public void **writeToParcel** ([Parcel](https://developer.android.com/reference/android/os/Parcel.html) dest, int flags)