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

com.hp.jipp.model.PowerState.kt Maven / Gradle / Ivy

There is a newer version: 0.7.16
Show newest version
// Copyright 2018 HP Development Company, L.P.
// SPDX-License-Identifier: MIT
//
// DO NOT MODIFY. Code is auto-generated by genTypes.py. Content taken from registry at
// https://www.iana.org/assignments/ipp-registrations/ipp-registrations.xml, updated on 2021-05-04
@file:Suppress("MaxLineLength", "WildcardImport")

package com.hp.jipp.model

import com.hp.jipp.encoding.* // ktlint-disable
import com.hp.jipp.encoding.Enum // Override java Enum

/**
 * "power-state" enum as defined in:
 * [PWG5100.22](https://ftp.pwg.org/pub/pwg/candidates/cs-ippsystem10-20191122-5100.22.pdf).
 */
data class PowerState(override val code: Int, override val name: String) : Enum() {

    override fun toString() = super.toString()

    /** An [AttributeType] for a [PowerState] attribute. */
    class Type(name: String) : EnumType(name, { get(it) })

    /** An [AttributeType] for multiple [PowerState] attributes. */
    class SetType(name: String) : EnumType.Set(name, { get(it) })

    object Code {
        const val on = 20
        const val onVendor1 = 21
        const val onVendor2 = 22
        const val onVendor3 = 23
        const val onVendor4 = 24
        const val onVendor5 = 25
        const val standby = 30
        const val standbyVendor1 = 31
        const val standbyVendor2 = 32
        const val standbyVendor3 = 33
        const val standbyVendor4 = 34
        const val standbyVendor5 = 35
        const val suspend = 40
        const val suspendVendor1 = 41
        const val suspendVendor2 = 42
        const val suspendVendor3 = 43
        const val suspendVendor4 = 44
        const val suspendVendor5 = 45
        const val resetSoft = 50
        const val offHard = 60
        const val hibernate = 70
        const val hibernateVendor1 = 71
        const val hibernateVendor2 = 72
        const val hibernateVendor3 = 73
        const val hibernateVendor4 = 74
        const val hibernateVendor5 = 75
        const val offSoft = 80
        const val offSoftVendor1 = 81
        const val offSoftVendor2 = 82
        const val offSoftVendor3 = 83
        const val offSoftVendor4 = 84
        const val offSoftVendor5 = 85
        const val resetHard = 90
        const val resetMbr = 100
        const val resetNmi = 110
        const val offSoftGraceful = 120
        const val offHardGraceful = 130
        const val resetMbrGraceful = 140
        const val resetSoftGraceful = 150
        const val resetHardGraceful = 160
        const val resetInit = 170
        const val notApplicable = 180
        const val noChange = 190
    }

    companion object {
        @JvmField val on = PowerState(Code.on, "on")
        @JvmField val onVendor1 = PowerState(Code.onVendor1, "on-vendor1")
        @JvmField val onVendor2 = PowerState(Code.onVendor2, "on-vendor2")
        @JvmField val onVendor3 = PowerState(Code.onVendor3, "on-vendor3")
        @JvmField val onVendor4 = PowerState(Code.onVendor4, "on-vendor4")
        @JvmField val onVendor5 = PowerState(Code.onVendor5, "on-vendor5")
        @JvmField val standby = PowerState(Code.standby, "standby")
        @JvmField val standbyVendor1 = PowerState(Code.standbyVendor1, "standby-vendor1")
        @JvmField val standbyVendor2 = PowerState(Code.standbyVendor2, "standby-vendor2")
        @JvmField val standbyVendor3 = PowerState(Code.standbyVendor3, "standby-vendor3")
        @JvmField val standbyVendor4 = PowerState(Code.standbyVendor4, "standby-vendor4")
        @JvmField val standbyVendor5 = PowerState(Code.standbyVendor5, "standby-vendor5")
        @JvmField val suspend = PowerState(Code.suspend, "suspend")
        @JvmField val suspendVendor1 = PowerState(Code.suspendVendor1, "suspend-vendor1")
        @JvmField val suspendVendor2 = PowerState(Code.suspendVendor2, "suspend-vendor2")
        @JvmField val suspendVendor3 = PowerState(Code.suspendVendor3, "suspend-vendor3")
        @JvmField val suspendVendor4 = PowerState(Code.suspendVendor4, "suspend-vendor4")
        @JvmField val suspendVendor5 = PowerState(Code.suspendVendor5, "suspend-vendor5")
        @JvmField val resetSoft = PowerState(Code.resetSoft, "reset-soft")
        @JvmField val offHard = PowerState(Code.offHard, "off-hard")
        @JvmField val hibernate = PowerState(Code.hibernate, "hibernate")
        @JvmField val hibernateVendor1 = PowerState(Code.hibernateVendor1, "hibernate-vendor1")
        @JvmField val hibernateVendor2 = PowerState(Code.hibernateVendor2, "hibernate-vendor2")
        @JvmField val hibernateVendor3 = PowerState(Code.hibernateVendor3, "hibernate-vendor3")
        @JvmField val hibernateVendor4 = PowerState(Code.hibernateVendor4, "hibernate-vendor4")
        @JvmField val hibernateVendor5 = PowerState(Code.hibernateVendor5, "hibernate-vendor5")
        @JvmField val offSoft = PowerState(Code.offSoft, "off-soft")
        @JvmField val offSoftVendor1 = PowerState(Code.offSoftVendor1, "off-soft-vendor1")
        @JvmField val offSoftVendor2 = PowerState(Code.offSoftVendor2, "off-soft-vendor2")
        @JvmField val offSoftVendor3 = PowerState(Code.offSoftVendor3, "off-soft-vendor3")
        @JvmField val offSoftVendor4 = PowerState(Code.offSoftVendor4, "off-soft-vendor4")
        @JvmField val offSoftVendor5 = PowerState(Code.offSoftVendor5, "off-soft-vendor5")
        @JvmField val resetHard = PowerState(Code.resetHard, "reset-hard")
        @JvmField val resetMbr = PowerState(Code.resetMbr, "reset-mbr")
        @JvmField val resetNmi = PowerState(Code.resetNmi, "reset-nmi")
        @JvmField val offSoftGraceful = PowerState(Code.offSoftGraceful, "off-soft-graceful")
        @JvmField val offHardGraceful = PowerState(Code.offHardGraceful, "off-hard-graceful")
        @JvmField val resetMbrGraceful = PowerState(Code.resetMbrGraceful, "reset-mbr-graceful")
        @JvmField val resetSoftGraceful = PowerState(Code.resetSoftGraceful, "reset-soft-graceful")
        @JvmField val resetHardGraceful = PowerState(Code.resetHardGraceful, "reset-hard-graceful")
        @JvmField val resetInit = PowerState(Code.resetInit, "reset-init")
        @JvmField val notApplicable = PowerState(Code.notApplicable, "not-applicable")
        @JvmField val noChange = PowerState(Code.noChange, "no-change")

        @JvmField val all = listOf(
            on,
            onVendor1,
            onVendor2,
            onVendor3,
            onVendor4,
            onVendor5,
            standby,
            standbyVendor1,
            standbyVendor2,
            standbyVendor3,
            standbyVendor4,
            standbyVendor5,
            suspend,
            suspendVendor1,
            suspendVendor2,
            suspendVendor3,
            suspendVendor4,
            suspendVendor5,
            resetSoft,
            offHard,
            hibernate,
            hibernateVendor1,
            hibernateVendor2,
            hibernateVendor3,
            hibernateVendor4,
            hibernateVendor5,
            offSoft,
            offSoftVendor1,
            offSoftVendor2,
            offSoftVendor3,
            offSoftVendor4,
            offSoftVendor5,
            resetHard,
            resetMbr,
            resetNmi,
            offSoftGraceful,
            offHardGraceful,
            resetMbrGraceful,
            resetSoftGraceful,
            resetHardGraceful,
            resetInit,
            notApplicable,
            noChange,
        ).map { it.code to it }.toMap()

        operator fun get(value: Int): PowerState =
            all[value] ?: PowerState(value, "???")
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy