From 6e4dfba40a1245aa0f7a3e95e2d576fd960673d4 Mon Sep 17 00:00:00 2001 From: Maria Anchugova Date: Tue, 20 Aug 2024 16:53:41 +0700 Subject: [PATCH] refactor (enum): add infix function and for enum set --- .../src/main/kotlin/com/personalization/utils/EnumUtils.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/personalization-sdk/src/main/kotlin/com/personalization/utils/EnumUtils.kt b/personalization-sdk/src/main/kotlin/com/personalization/utils/EnumUtils.kt index 0ddb2faf..18296f2c 100644 --- a/personalization-sdk/src/main/kotlin/com/personalization/utils/EnumUtils.kt +++ b/personalization-sdk/src/main/kotlin/com/personalization/utils/EnumUtils.kt @@ -7,4 +7,9 @@ object EnumUtils { inline fun > getEnumsString(enums: EnumSet): String { return enums.joinToString(",") { it.toString() } } + + infix fun> EnumSet.and(other: T): EnumSet { + this.add(other) + return this + } }