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

com.hp.jipp.model.InputScanRegionsSupported.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 "input-scan-regions-supported" collection as defined in:
 * [PWG5100.15](https://ftp.pwg.org/pub/pwg/candidates/cs-ippfaxout10-20131115-5100.15.pdf).
 */
@Suppress("RedundantCompanionReference", "unused")
data class InputScanRegionsSupported
constructor(
    var xDimension: IntRange? = null,
    var xOrigin: IntRange? = null,
    var yDimension: IntRange? = null,
    var yOrigin: IntRange? = null
) : AttributeCollection {

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

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

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

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

    /** Types for each member attribute. */
    object Types {
        val xDimension = IntRangeType(Name.xDimension)
        val xOrigin = IntRangeType(Name.xOrigin)
        val yDimension = IntRangeType(Name.yDimension)
        val yOrigin = IntRangeType(Name.yOrigin)
    }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy