fix(autoversion): don't use modern kotlin
All checks were successful
ci/woodpecker/push/gradle Pipeline was successful
ci/woodpecker/push/pages Pipeline was successful

This commit is contained in:
Johannes Frohnmeyer 2024-06-09 10:22:46 +02:00
parent 45e59ab24a
commit 9513cd7ce8
Signed by: Johannes
GPG Key ID: E76429612C2929F4

View File

@ -1,7 +1,5 @@
package io.gitlab.jfronny.scripts
import java.util.stream.Collectors
enum class VersionType(val displayName: String, val curseforgeName: String, val modrinthName: String, val semanticName: String, val shorthand: String): Comparable<VersionType> {
ALPHA("Alpha", "alpha", "alpha", "alpha", "a"),
BETA("Beta", "beta", "beta", "beta", "b"),
@ -10,8 +8,8 @@ enum class VersionType(val displayName: String, val curseforgeName: String, val
RELEASE("Release", "release", "release", "release", "v");
companion object {
private val byShorthand = entries.stream().collect(Collectors.toUnmodifiableMap({ it.shorthand }, { it }))
private val byName = entries.stream().collect(Collectors.toUnmodifiableMap({ it.semanticName }, { it }))
private val byShorthand = values().associateBy { it.shorthand }
private val byName = values().associateBy { it.semanticName }
fun byShorthand(shorthand: String): VersionType? = byShorthand[shorthand]
fun byName(name: String): VersionType? = byName[name]
}