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

mlrpc.protocol.2.0.1.source-code.Value.kt Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
/*
 * Copyright (c) 2022 Andreas Scheja. Use of this source code is governed by the Apache 2.0 license.
 */

package org.ascheja.xmlrpc.protocol

import java.util.Base64

public sealed interface Value

public data class IntegerValue(val value: Int) : Value

public data class BooleanValue(val value: Boolean) : Value

public data class StringValue(val value: String) : Value

public data class DoubleValue(val value: Double) : Value

public data class DateTimeIso8601Value(val value: String) : Value

public data class Base64Value(val value: String) : Value {
    public fun toByteArray(): ByteArray = Base64.getDecoder().decode(value)
}

public data class StructValue(val members: Map) : Value {
    public constructor(vararg members: Pair) : this(members.toMap())
}

public data class ArrayValue(val data: List) : Value {
    public constructor(vararg data: Value) : this(data.toList())
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy