Big refactoring #77

Merged
flecomte merged 166 commits from refactoring-component-and-immutable into master 2021-03-24 19:06:07 +01:00
Showing only changes of commit d9f19a9c23 - Show all commits

View File

@@ -5,16 +5,8 @@ enum class AccessDecision {
GRANTED, GRANTED,
DENIED; DENIED;
/** Helper to convert true/false to GRANTED/DENIED */
companion object {
fun toVote(lambda: () -> Boolean): AccessDecision = when (lambda()) {
true -> GRANTED
false -> DENIED
}
}
/** /**
* Convert vote to boolean * Convert decision to boolean
*/ */
fun toBoolean(): Boolean = when (this) { fun toBoolean(): Boolean = when (this) {
GRANTED -> true GRANTED -> true