Created
December 5, 2017 19:37
-
-
Save bes89/cd9c02ebc1609b0b84314b3c9b3242f9 to your computer and use it in GitHub Desktop.
job posting for a start-up looking for an android/kotlin dev
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
data class Skill(val description: String) | |
interface AwesomeGuy | |
interface AndroidGeek | |
interface TeamPlayer | |
object MateCrte { | |
val skills = mutableListOf<Skill>() | |
val members = mutableListOf<AwesomeGuy>() | |
val benefits = mutableListOf<String>() | |
fun beAwesome(andDoThis: () -> Unit) = andDoThis() | |
fun wilBeEvenMoreAwesome() = true | |
} | |
data class Person(val skills: Set<Skill>, val benefits: MutableList<String> = mutableListOf()) : | |
AwesomeGuy, TeamPlayer, AndroidGeek | |
val you: Person? = Person(setOf(Skill("..."), Skill("..."))) | |
val bigBang = fun() { | |
MateCrte.let { | |
it.beAwesome { | |
you?.apply { | |
to(MateCrte) | |
when { | |
skills.isNotEmpty() && | |
this is TeamPlayer && | |
this is AwesomeGuy -> { | |
MateCrte.members.add(you) | |
with(you as AndroidGeek) { | |
it.wilBeEvenMoreAwesome() | |
fun yeah() {} | |
also { | |
you.benefits.addAll(MateCrte.benefits) | |
} | |
} | |
} | |
else -> run { print("sry") } | |
} | |
} ?: print("NPE caught") | |
} | |
} | |
}.invoke() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment