Created
January 9, 2016 15:19
-
-
Save yyYank/2c77182b1e2007ce0c1d to your computer and use it in GitHub Desktop.
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
interface Func{} | |
class Function<T>(val f: () -> T) : Func{ | |
fun invoke() = f() | |
} | |
class Function1<T>(val f: (value : String) -> T) : Func{ | |
fun invoke(value : String) = f(value) | |
} | |
val BY_SELECTING_ATTRIBUTES = mapOf<String, Func>(Pair("id", Function1<By>({id -> | |
By.id(id) | |
})), Pair("clazz", Function<java.lang.Class<By>>({ | |
By::class.java | |
})),Pair("name", Function1<By>{ name -> | |
By.name(name) | |
})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment