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

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

There is a newer version: 0.7.16
Show newest version
// Copyright 2017 HP Development Company, L.P.
// SPDX-License-Identifier: MIT

package com.hp.jipp.encoding

/**
 * Describes a name object, which may or may not have a language string.
 */
data class Name(override val value: String, val lang: String?) : TaggedValue, Stringable {
    constructor(value: String) : this(value, null)

    override val tag = if (lang == null) Tag.nameWithoutLanguage else Tag.nameWithLanguage

    override fun asString() = value

    override fun toString() =
        if (lang == null) {
            "\"$value\" (name)"
        } else {
            "\"$value\" ($lang name)"
        }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy