com.hp.jipp.encoding.Stringable.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jipp-core Show documentation
Show all versions of jipp-core Show documentation
IPP packet builder/parser
// Copyright 2017 HP Development Company, L.P.
// SPDX-License-Identifier: MIT
package com.hp.jipp.encoding
/** An object that has a native string representation. */
interface Stringable {
/**
* Return the most basic string representation of a value without any decorators or extra info
* which might be present.
*/
fun asString(): String
}
/** Convert a list of items that might be [Stringable] into strings and leave everything else alone. */
internal fun Collection<*>.stringinate(): List<*> =
map { if (it is Stringable) it.asString() else it }
© 2015 - 2024 Weber Informatics LLC | Privacy Policy