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

com.hp.jipp.model.PrintAccuracySupported.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 "print-accuracy-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 PrintAccuracySupported
constructor(
    /** May contain any keyword from [AccuracyUnit]. */
    var accuracyUnits: String? = null,
    var xAccuracy: Int? = null,
    var yAccuracy: Int? = null,
    var zAccuracy: Int? = null
) : AttributeCollection {

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

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

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

    /** All member names as strings. */
    object Name {
        /** "accuracy-units" member name */
        const val accuracyUnits = "accuracy-units"
        /** "x-accuracy" member name */
        const val xAccuracy = "x-accuracy"
        /** "y-accuracy" member name */
        const val yAccuracy = "y-accuracy"
        /** "z-accuracy" member name */
        const val zAccuracy = "z-accuracy"
    }

    /** Types for each member attribute. */
    object Types {
        val accuracyUnits = KeywordType(Name.accuracyUnits)
        val xAccuracy = IntType(Name.xAccuracy)
        val yAccuracy = IntType(Name.yAccuracy)
        val zAccuracy = IntType(Name.zAccuracy)
    }

    /** Defines types for each member of [PrintAccuracySupported] */
    companion object : AttributeCollection.Converter {
        override fun convert(attributes: List>): PrintAccuracySupported =
            PrintAccuracySupported(
                extractOne(attributes, Types.accuracyUnits),
                extractOne(attributes, Types.xAccuracy),
                extractOne(attributes, Types.yAccuracy),
                extractOne(attributes, Types.zAccuracy)
            )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy