Created
June 10, 2018 16:15
-
-
Save juancho088/42ab0f8d089421d23e6de8c36314a254 to your computer and use it in GitHub Desktop.
Dispatcher interface for Kotlin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.myblockbuster.core.dispatchers | |
/** | |
* Dispatcher on charge of routing our client request to the correct function | |
* @param K Key type | |
* @param T Return object type | |
*/ | |
interface Dispatcher<in K, out T> { | |
/** | |
* Function that finds and executes a specific function given a {@link K} unique key | |
* returning a {@link T} result object | |
* @param key Unique key to find and execute a function | |
* @return T | |
*/ | |
fun locate(key: K): T? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment