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

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

// Copyright 2018 - 2024 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 2024-06-13
@file:Suppress("MaxLineLength", "WildcardImport")

package com.hp.jipp.model

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

/**
 * Data object corresponding to a "overrides" collection as defined in:
 * [PWG5100.6](https://ftp.pwg.org/pub/pwg/candidates/cs-ipppageoverride10-20031031-5100.6.pdf).
 */
@Suppress("RedundantCompanionReference", "unused")
data class Overrides
constructor(
    var pages: List? = null,
    var documentNumbers: List? = null,
    var documentCopies: List? = null,
    /** Additional attributes (see specification for valid values). */
    var extras: AttributeGroup = groupOf(Tag.jobAttributes),
) : AttributeCollection {

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

    /** Produce an attribute list from members. */
    override val attributes: List>
        get() = listOfNotNull(
            pages?.let { Overrides.pages.of(it) },
            documentNumbers?.let { Overrides.documentNumbers.of(it) },
            documentCopies?.let { Overrides.documentCopies.of(it) },
        ) + extras

    /** Defines types for each member of [Overrides]. */
    companion object : AttributeCollection.Converter {
        override fun convert(attributes: List>): Overrides =
            Overrides(
                extractAll(attributes, pages),
                extractAll(attributes, documentNumbers),
                extractAll(attributes, documentCopies),
                groupOf(
                    Tag.jobAttributes,
                    attributes.filterNot { it.name == pages.name || it.name == documentNumbers.name || it.name == documentCopies.name }
                ),
            )
        override val cls = Overrides::class.java
        @Deprecated("Remove this symbol")
        @JvmField val Types = this
        @JvmField val pages = IntRangeType.Set("pages")
        @JvmField val documentNumbers = IntRangeType.Set("document-numbers")
        @JvmField val documentCopies = IntRangeType.Set("document-copies")
    }
    override fun toString() = "Overrides(${attributes.joinToString()})"
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy