Skip to content

Commit

Permalink
chore: replace deprecated Kotlin methods in enums
Browse files Browse the repository at this point in the history
  • Loading branch information
bobeal committed Nov 22, 2023
1 parent 87f82f2 commit 8df4712
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ enum class AttributeType(val key: String) {

companion object {
fun forKey(key: String): AttributeType =
values().find { it.key == key }!!
entries.find { it.key == key }!!
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ data class GeoQuery(

companion object {
fun isSupportedType(type: String): Boolean =
values().any { it.type == type }
entries.any { it.type == type }

fun forType(type: String): GeometryType? =
values().find { it.type == type }
entries.find { it.type == type }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ enum class GlobalRole(val key: String) {

companion object {
fun forKey(key: String): Option<GlobalRole> =
values().find { it.key == key }.toOption()
entries.find { it.key == key }.toOption()
}
}

Expand All @@ -139,7 +139,7 @@ enum class AccessRight(val attributeName: String) {

companion object {
fun forAttributeName(attributeName: String): Option<AccessRight> =
values().find { it.attributeName == attributeName.removePrefix(AUTHORIZATION_ONTOLOGY) }.toOption()
entries.find { it.attributeName == attributeName.removePrefix(AUTHORIZATION_ONTOLOGY) }.toOption()

fun forExpandedAttributeName(attributeName: ExpandedTerm): Option<AccessRight> =
when (attributeName) {
Expand Down

0 comments on commit 8df4712

Please sign in to comment.