Kotlin – Regulate a set of broadcasts to listener via Mediator Pattern
Kotlin – Regulate a set of broadcasts to listener via Mediator Pattern

The definition of “mediator” is, a person who attempts to make people involved in a conflict come to an agreement; a go-between. Problem Solution The Mediator pattern suggests that all direct communication should be ceased between the components. Instead, these components must collaborate indirectly, by calling a special mediator object that redirects the calls to... » read more

Kotlin – Tips & Tricks
Kotlin – Tips & Tricks

You may try this with Kotlin Playground -> https://play.kotlinlang.org Swap two values w/o temp variable a = b.also { b = a } is equivalent to followings: Enum Reverse Look-up

Kotlin – Idiomatic Way to Deal with Null-able
Kotlin – Idiomatic Way to Deal with Null-able

In Kotlin, a null-able value without being sure it is not null cannot be accessed. (Checking for null in conditions), or asserting that it is surely not null using the !! sure operator, accessing it with a ?. Safe Call, or lastly giving something that is possibly null a default value using the ?: Elvis... » read more

Kotlin – Use EnumSet For RBAC
Kotlin – Use EnumSet For RBAC

Enumset is a powerful collection in Java to replace bit fields. This article will explains how to use EnumSet to create a RBAC (Role-Based Access Control). Now, let’s see how we can use EnumSet to create a RBAC. Inside the setup method, a series of roles with specific access right in a given system has been defined... » read more