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

net.nemerosa.ontrack.model.support.Action.kt Maven / Gradle / Ivy

There is a newer version: 4.4.5
Show newest version
package net.nemerosa.ontrack.model.support

import java.net.URI

class Action(
        val id: String,
        val name: String,
        val type: ActionType,
        val uri: String
) {

    fun withUri(uri: String): Action {
        return of(id, name, uri)
    }

    companion object {

        @JvmStatic
        fun of(id: String, name: String, uri: String, vararg parameters: Any): Action {
            return Action(id, name, ActionType.LINK, String.format(uri, *parameters))
        }

        @JvmStatic
        fun form(id: String, name: String, formUri: URI): Action {
            return Action(id, name, ActionType.FORM, formUri.toString())
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy