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()
}
}