interface Action { | |
val name: String | |
fun execute(response: Response) | |
} | |
class Print : Action { | |
override val name: String = "print" | |
override fun execute(response: Response) { | |
println("printing ${response.value}...") | |
} | |
} | |
class Log : Action { | |
override val name: String = "log" | |
override fun execute(response: Response) { | |
println("logging ${response.value}...") | |
} | |
} | |
class WriteToFile : Action { | |
override val name: String = "write_to_file" | |
override fun execute(response: Response) { | |
println("writing to file ${response.value}...") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment