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

io.javalin.plugin.openapi.dsl.OpenApiUpdater.kt Maven / Gradle / Ivy

There is a newer version: 6.2.0
Show newest version
package io.javalin.plugin.openapi.dsl

@FunctionalInterface
interface OpenApiUpdater {
    fun applyUpdates(value: T)
}

typealias ApplyUpdates = (value: T) -> Unit

fun  createUpdaterIfNotNull(function: ApplyUpdates?) = function?.let { createUpdater(it) }

fun  createUpdater(function: ApplyUpdates) = object : OpenApiUpdater {
    override fun applyUpdates(value: T) = function(value)
}

fun  List>.applyAllUpdates(value: T) = this.forEach { it.applyUpdates(value) }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy