# CustomModel


```
public class CustomModel
```

<br />

*** ** * ** ***

> [!CAUTION]
> **This class is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Stores information about custom models that are being downloaded or are already downloaded on a device. In the case where an update is available, after the updated model file is fully downloaded, the original model file will be removed once it is safe to do so.

## Summary

| ### Public fields |
|---|---|
| `final long` | `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#downloadId()` |
| `final https://developer.android.com/reference/kotlin/java/lang/String.html` | `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#downloadUrl()` |
| `final long` | `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#downloadUrlExpiry()` |
| `final https://developer.android.com/reference/kotlin/java/lang/String.html` | `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#localFilePath()` |
| `final https://developer.android.com/reference/kotlin/java/lang/String.html` | `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#modelHash()` |
| `final https://developer.android.com/reference/kotlin/java/lang/String.html` | `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#name()` |

| ### Public methods |
|---|---|
| `boolean` | `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#equals(java.lang.Object)(https://developer.android.com/reference/kotlin/java/lang/Object.html o)` |
| `long` | `[getDownloadId](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#getDownloadId())()` **This method is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/Nullable.html https://developer.android.com/reference/kotlin/java/io/File.html` | `[getFile](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#getFile())()` **This method is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://developer.android.com/reference/kotlin/java/lang/String.html` | `[getModelHash](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#getModelHash())()` **This method is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://developer.android.com/reference/kotlin/java/lang/String.html` | `[getName](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#getName())()` **This method is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `long` | `[getSize](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#getSize())()` **This method is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. <br /> |
| `int` | `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#hashCode()()` |
| `@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://developer.android.com/reference/kotlin/java/lang/String.html` | `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#toString()()` |

| ### Extension functions |
|---|---|
| `final https://developer.android.com/reference/kotlin/java/io/File.html` | `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/ModelDownloaderKt.[component1](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#(com.google.firebase.ml.modeldownloader.CustomModel).component1())(@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel receiver)` **This method is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. |
| `final long` | `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/ModelDownloaderKt.[component2](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#(com.google.firebase.ml.modeldownloader.CustomModel).component2())(@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel receiver)` **This method is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. |
| `final long` | `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/ModelDownloaderKt.[component3](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#(com.google.firebase.ml.modeldownloader.CustomModel).component3())(@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel receiver)` **This method is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. |
| `final @https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://developer.android.com/reference/kotlin/java/lang/String.html` | `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/ModelDownloaderKt.[component4](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#(com.google.firebase.ml.modeldownloader.CustomModel).component4())(@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel receiver)` **This method is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. |
| `final @https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://developer.android.com/reference/kotlin/java/lang/String.html` | `https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/ModelDownloaderKt.[component5](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#(com.google.firebase.ml.modeldownloader.CustomModel).component5())(@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel receiver)` **This method is deprecated.** Firebase ML is deprecated and will be shut down on June 15, 2027. |

## Public fields

### downloadId

```
public final long downloadId
```

### downloadUrl

```
public final String downloadUrl
```

### downloadUrlExpiry

```
public final long downloadUrlExpiry
```

### localFilePath

```
public final String localFilePath
```

### modelHash

```
public final String modelHash
```

### name

```
public final String name
```

## Public methods

### equals

```
public boolean equals(Object o)
```

### getDownloadId

```
public long [getDownloadId](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#getDownloadId())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

The download ID (returns 0 if no download in progress), which can be used with the Android `DownloadManager` to query download progress. The retrieved progress information can be used to populate a progress bar, monitor when an updated model is available, etc.

| Returns |
|---|---|
| `long` | The download ID (if download in progress), otherwise returns 0. |

### getFile

```
public @Nullable File [getFile](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#getFile())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

The local model file. If `null` is returned, use the download ID to check the download status.

| Returns |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/Nullable.html https://developer.android.com/reference/kotlin/java/io/File.html` | The local file associated with the model. If the original file download is still in progress, returns `null`. If a file update is in progress, returns the last fully downloaded model. |

### getModelHash

```
public @NonNull String [getModelHash](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#getModelHash())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Retrieves the model hash.

| Returns |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://developer.android.com/reference/kotlin/java/lang/String.html` | The model hash |

### getName

```
public @NonNull String [getName](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#getName())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

Retrieves the model name and identifier.

| Returns |
|---|---|
| `@https://developer.android.com/reference/kotlin/androidx/annotation/NonNull.html https://developer.android.com/reference/kotlin/java/lang/String.html` | The name of the model. |

### getSize

```
public long [getSize](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#getSize())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more info, see https://firebase.google.com/docs/ml/migrate-to-cloud-storage

The size of the file currently associated with this model. If a download is in progress, this will be the size of the current model, not the new model currently being downloaded.

| Returns |
|---|---|
| `long` | The local model size. |

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```

## Extension functions

### ModelDownloaderKt.component1

```
public final File ModelDownloaderKt.[component1](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#(com.google.firebase.ml.modeldownloader.CustomModel).component1())(@NonNull CustomModel receiver)
```

> [!CAUTION]
> **This method is deprecated.**   
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more information about migration options, see the notification banner in the \[Firebase ML documentation\](https://firebase.google.com/docs/ml).

### ModelDownloaderKt.component2

```
public final long ModelDownloaderKt.[component2](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#(com.google.firebase.ml.modeldownloader.CustomModel).component2())(@NonNull CustomModel receiver)
```

> [!CAUTION]
> **This method is deprecated.**   
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more information about migration options, see the notification banner in the \[Firebase ML documentation\](https://firebase.google.com/docs/ml).

### ModelDownloaderKt.component3

```
public final long ModelDownloaderKt.[component3](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#(com.google.firebase.ml.modeldownloader.CustomModel).component3())(@NonNull CustomModel receiver)
```

> [!CAUTION]
> **This method is deprecated.**   
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more information about migration options, see the notification banner in the \[Firebase ML documentation\](https://firebase.google.com/docs/ml).

### ModelDownloaderKt.component4

```
public final @NonNull String ModelDownloaderKt.[component4](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#(com.google.firebase.ml.modeldownloader.CustomModel).component4())(@NonNull CustomModel receiver)
```

> [!CAUTION]
> **This method is deprecated.**   
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more information about migration options, see the notification banner in the \[Firebase ML documentation\](https://firebase.google.com/docs/ml).

### ModelDownloaderKt.component5

```
public final @NonNull String ModelDownloaderKt.[component5](https://firebase.google.com/docs/reference/android/com/google/firebase/ml/modeldownloader/CustomModel#(com.google.firebase.ml.modeldownloader.CustomModel).component5())(@NonNull CustomModel receiver)
```

> [!CAUTION]
> **This method is deprecated.**   
> Firebase ML is deprecated and will be shut down on June 15, 2027. To host custom models, you must migrate to another solution. You can use Cloud Storage for Firebase as an alternative for hosting custom models. For more information about migration options, see the notification banner in the \[Firebase ML documentation\](https://firebase.google.com/docs/ml).