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

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

// 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 2019-05-28
@file:Suppress("MaxLineLength", "WildcardImport")

package com.hp.jipp.model

import com.hp.jipp.encoding.* // ktlint-disable no-wildcard-imports

/**
 * Data object corresponding to a "printer-volume-supported" collection as defined in:
 * [PWG5100.21](https://ftp.pwg.org/pub/pwg/candidates/cs-ipp3d11-20190329-5100.21.pdf).
 */
@Suppress("RedundantCompanionReference", "unused")
data class PrinterVolumeSupported
constructor(
    var xDimension: Int? = null,
    var yDimension: Int? = null,
    var zDimension: Int? = null
) : AttributeCollection {

    /** Construct an empty [PrinterVolumeSupported]. */
    constructor() : this(null, null, null)

    /** Produce an attribute list from members. */
    override val attributes: List> by lazy {
        listOfNotNull(
            xDimension?.let { Types.xDimension.of(it) },
            yDimension?.let { Types.yDimension.of(it) },
            zDimension?.let { Types.zDimension.of(it) }
        )
    }

    /** Type for attributes of this collection */
    class Type(override val name: String) : AttributeCollection.Type(PrinterVolumeSupported)

    /** All member names as strings. */
    object Name {
        /** "x-dimension" member name */
        const val xDimension = "x-dimension"
        /** "y-dimension" member name */
        const val yDimension = "y-dimension"
        /** "z-dimension" member name */
        const val zDimension = "z-dimension"
    }

    /** Types for each member attribute. */
    object Types {
        val xDimension = IntType(Name.xDimension)
        val yDimension = IntType(Name.yDimension)
        val zDimension = IntType(Name.zDimension)
    }

    /** Defines types for each member of [PrinterVolumeSupported] */
    companion object : AttributeCollection.Converter {
        override fun convert(attributes: List>): PrinterVolumeSupported =
            PrinterVolumeSupported(
                extractOne(attributes, Types.xDimension),
                extractOne(attributes, Types.yDimension),
                extractOne(attributes, Types.zDimension)
            )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy