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

it.unibo.collektive.alchemist.device.sensors.EnvironmentVariables.kt Maven / Gradle / Ivy

The newest version!
package it.unibo.collektive.alchemist.device.sensors

/**
 * Interface for generic environment variables.
 */
interface EnvironmentVariables {
    /**
     * Get the value of the variable with the given [name].
     */
    operator fun  get(name: String): T

    /**
     * Get the value of the variable with the given [name], or `null` if the variable is not defined.
     */
    fun  getOrNull(name: String): T?

    /**
     * Get the value of the variable with the given [name], or [default] if the variable is not defined.
     */
    fun  getOrDefault(
        name: String,
        default: T,
    ): T

    /**
     * Check if the variable with the given [name] is defined inside the environment.
     */
    fun isDefined(name: String): Boolean

    /**
     * Set the value of the variable with the given [name] to [value].
     */
    operator fun  set(
        name: String,
        value: T,
    ): T
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy