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

com.hp.jipp.encoding.UnknownAttribute.kt Maven / Gradle / Ivy

// Copyright 2017 - 2020 HP Development Company, L.P.
// SPDX-License-Identifier: MIT

package com.hp.jipp.encoding

/**
 * An otherwise unrecognized attribute, including at least one value, containing values of any legal type that
 * can be expressed in IPP form.
 */
class UnknownAttribute(
    name: String,
    values: List
) : AttributeImpl(name, Type(name), values) {

    /** Provide values as varargs. */
    constructor(name: String, value: Any, vararg values: Any) : this(name, listOf(value) + values)

    /** An unknown [AttributeType]. */
    class Type(override val name: String) : AttributeType {
        override fun coerce(value: Any): Any? = value
    }

    /** An unknown [AttributeType] carrying multiple values. */
    class SetType(override val name: String) : AttributeSetType {
        override fun coerce(value: Any): Any? = value
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy