replace Enum.values() with Enum.entries

Mon, 30 Oct 2023 10:06:22 +0100

author
Mike Becker <universe@uap-core.de>
date
Mon, 30 Oct 2023 10:06:22 +0100
changeset 291
bcf05cccac6f
parent 290
51b14787d826
child 292
703591e739f4

replace Enum.values() with Enum.entries

src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt file | annotate | diff | comparison | revisions
src/main/kotlin/de/uapcore/lightpit/viewmodel/Versions.kt file | annotate | diff | comparison | revisions
--- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt	Mon Oct 30 10:02:58 2023 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/Issues.kt	Mon Oct 30 10:06:22 2023 +0100
@@ -115,7 +115,7 @@
     val relationError: String?,
     commitRefs: List<CommitRef>
 ) : View() {
-    val relationTypes = RelationType.values()
+    val relationTypes = RelationType.entries
     val linkableIssues = projectIssues.filterNot { it.id == issue.id }
     val commitLinks: List<CommitLink>
 
@@ -175,8 +175,8 @@
     val versionsUpcoming: List<Version>
     val versionsRecent: List<Version>
 
-    val issueStatus = IssueStatus.values()
-    val issueCategory = IssueCategory.values()
+    val issueStatus = IssueStatus.entries
+    val issueCategory = IssueCategory.entries
 
     init {
         val recent = mutableListOf<Version>()
@@ -198,9 +198,9 @@
 
 class IssueFilter(http: HttpRequest) {
 
-    val issueStatus = IssueStatus.values()
-    val issueCategory = IssueCategory.values()
-    val sortCriteria = IssueSorter.Field.values().flatMap { listOf(IssueSorter.Criteria(it, true), IssueSorter.Criteria(it, false)) }
+    val issueStatus = IssueStatus.entries
+    val issueCategory = IssueCategory.entries
+    val sortCriteria = IssueSorter.Field.entries.flatMap { listOf(IssueSorter.Criteria(it, true), IssueSorter.Criteria(it, false)) }
     val flagIncludeDone = "f.0"
     val flagMine = "f.1"
     val flagBlocker = "f.2"
--- a/src/main/kotlin/de/uapcore/lightpit/viewmodel/Versions.kt	Mon Oct 30 10:02:58 2023 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/viewmodel/Versions.kt	Mon Oct 30 10:06:22 2023 +0100
@@ -72,5 +72,5 @@
     val projectInfo: ProjectInfo,
     val version: Version
 ) : EditView() {
-    val versionStatus = VersionStatus.values()
+    val versionStatus = VersionStatus.entries
 }

mercurial