Difference between OneTimeWorkRequest.Builder and OneTimeWorkRequestBuilder?

Viewed 472

I am going through the Google Codelabs Android basics for Kotlin WorkManager. I've seen the code written one way, then later on see it a different way, and was wondering if there was a difference at all between these?

// Add WorkRequest to save the image to the filesystem
val save = OneTimeWorkRequest.Builder(SaveImageToFileWorker::class.java).build()
// Add WorkRequest to save the image to the filesystem
val save = OneTimeWorkRequestBuilder<SaveImageToFileWorker>()
        .build()

Do these do the same thing?

1 Answers

OneTimeWorkRequestBuilder<T>() is just a function that creates and returns an object of type OneTimeWorkRequest.Builder and there are no differences between them. You can check the OneTimeWorkRequestBuilder function signuature here.

Related