fix(autoversion): don't use modern kotlin
This commit is contained in:
parent
45e59ab24a
commit
9513cd7ce8
@ -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]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user