All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.freya022.botcommands.api.commands.application.ValueRange.kt Maven / Gradle / Ivy

Go to download

A Kotlin-first (and Java) framework that makes creating Discord bots a piece of cake, using the JDA library.

There is a newer version: 3.0.0-alpha.18
Show newest version
package io.github.freya022.botcommands.api.commands.application

class ValueRange private constructor(val min: Number, val max: Number) {
    companion object {
        @JvmStatic
        fun ofLong(minValue: Long, maxValue: Long) =
            ValueRange(minValue, maxValue)

        @JvmStatic
        fun ofDouble(minValue: Double, maxValue: Double) =
            ValueRange(minValue, maxValue)

        infix fun Long.range(maxValue: Long) = ValueRange(this, maxValue)

        infix fun Int.range(maxValue: Int) = ValueRange(this, maxValue)

        infix fun Double.range(maxValue: Double) = ValueRange(this, maxValue)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy