All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.KrontabTemplateWrapper.kt Maven / Gradle / Ivy

The newest version!
package dev.inmo.krontab

/**
 * This class contains [template] and can be simply serialized/deserialized. In fact that class will work as
 * [dev.inmo.krontab.internal.CronDateTimeScheduler] due to the fact that [toKronScheduler] will return it under the
 * hood
 */
@Deprecated(
    "It is useless wrapper for KrontabTemplate. Use KrontabConfig instead",
    ReplaceWith("KrontabConfig(template)", "dev.inmo.krontab.KrontabConfig")
)
data class KrontabTemplateWrapper(
    val template: KrontabTemplate
) : KronScheduler by template.toKronScheduler()

/**
 * Will create [KrontabTemplateWrapper] from [this] [KrontabTemplate]
 *
 * @see [toKronScheduler]
 * @see [KrontabTemplateWrapper]
 */
@Deprecated(
    "Will be removed in near major update with KrontabTemplateWrapper",
    ReplaceWith("this.krontabConfig", "dev.inmo.krontab.krontabConfig")
)
fun KrontabTemplate.wrapAsKronScheduler() = KrontabTemplateWrapper(this)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy