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

xyz.shoaky.sourcedownloader.sdk.MapPatternVariables.kt Maven / Gradle / Ivy

The newest version!
package xyz.shoaky.sourcedownloader.sdk

class MapPatternVariables() : PatternVariables {
    constructor(variables: Map) : this() {
        this.variables.putAll(variables)
    }

    constructor(variables: PatternVariables) : this() {
        this.variables.putAll(variables.variables())
    }

    private val variables: MutableMap = mutableMapOf()

    override fun variables(): Map {
        return variables
    }

    fun addVariable(name: String, value: String) {
        variables[name] = value
    }

    fun addVariables(variables: PatternVariables) {
        this.variables.putAll(variables.variables())
    }

    fun getVariables(): Map {
        return variables
    }

    override fun toString(): String {
        return variables.toString()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy