Skip to content

Commit

Permalink
CBOR: polish CborConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
JesusMcCloud committed Jul 15, 2024
1 parent 46227cf commit 167877b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion formats/cbor/api/kotlinx-serialization-cbor.api
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ public final class kotlinx/serialization/cbor/CborBuilder {
}

public final class kotlinx/serialization/cbor/CborConfiguration {
public fun <init> (ZZZZZZZZZZZ)V
public final fun getAlwaysUseByteString ()Z
public final fun getEncodeDefaults ()Z
public final fun getEncodeKeyTags ()Z
Expand All @@ -65,6 +64,7 @@ public final class kotlinx/serialization/cbor/CborConfiguration {
public final fun getVerifyKeyTags ()Z
public final fun getVerifyObjectTags ()Z
public final fun getVerifyValueTags ()Z
public fun toString ()Ljava/lang/String;
}

public abstract interface class kotlinx/serialization/cbor/CborDecoder : kotlinx/serialization/encoding/Decoder {
Expand Down
2 changes: 1 addition & 1 deletion formats/cbor/api/kotlinx-serialization-cbor.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ final class kotlinx.serialization.cbor/CborBuilder { // kotlinx.serialization.cb
final fun <set-verifyValueTags>(kotlin/Boolean) // kotlinx.serialization.cbor/CborBuilder.verifyValueTags.<set-verifyValueTags>|<set-verifyValueTags>(kotlin.Boolean){}[0]
}
final class kotlinx.serialization.cbor/CborConfiguration { // kotlinx.serialization.cbor/CborConfiguration|null[0]
constructor <init>(kotlin/Boolean, kotlin/Boolean, kotlin/Boolean, kotlin/Boolean, kotlin/Boolean, kotlin/Boolean, kotlin/Boolean, kotlin/Boolean, kotlin/Boolean, kotlin/Boolean, kotlin/Boolean) // kotlinx.serialization.cbor/CborConfiguration.<init>|<init>(kotlin.Boolean;kotlin.Boolean;kotlin.Boolean;kotlin.Boolean;kotlin.Boolean;kotlin.Boolean;kotlin.Boolean;kotlin.Boolean;kotlin.Boolean;kotlin.Boolean;kotlin.Boolean){}[0]
final fun toString(): kotlin/String // kotlinx.serialization.cbor/CborConfiguration.toString|toString(){}[0]
final val alwaysUseByteString // kotlinx.serialization.cbor/CborConfiguration.alwaysUseByteString|{}alwaysUseByteString[0]
final fun <get-alwaysUseByteString>(): kotlin/Boolean // kotlinx.serialization.cbor/CborConfiguration.alwaysUseByteString.<get-alwaysUseByteString>|<get-alwaysUseByteString>(){}[0]
final val encodeDefaults // kotlinx.serialization.cbor/CborConfiguration.encodeDefaults|{}encodeDefaults[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

package kotlinx.serialization.cbor

import kotlinx.serialization.*

/**
* Configuration of the current [Cbor] instance available through [Cbor.configuration].
*
Expand Down Expand Up @@ -88,7 +90,8 @@ package kotlinx.serialization.cbor
* to annotate every `ByteArray` in a class hierarchy.
*
*/
public class CborConfiguration(
@ExperimentalSerializationApi
public class CborConfiguration internal constructor(
public val encodeDefaults: Boolean,
public val ignoreUnknownKeys: Boolean,
public val encodeKeyTags: Boolean,
Expand All @@ -100,4 +103,12 @@ public class CborConfiguration(
public val useDefiniteLengthEncoding: Boolean,
public val preferCborLabelsOverNames: Boolean,
public val alwaysUseByteString: Boolean,
)
) {
override fun toString(): String {
return "CborConfiguration(encodeDefaults=$encodeDefaults, ignoreUnknownKeys=$ignoreUnknownKeys, " +
"encodeKeyTags=$encodeKeyTags, encodeValueTags=$encodeValueTags, encodeObjectTags=$encodeObjectTags, " +
"verifyKeyTags=$verifyKeyTags, verifyValueTags=$verifyValueTags, verifyObjectTags=$verifyObjectTags, " +
"useDefiniteLengthEncoding=$useDefiniteLengthEncoding, " +
"preferCborLabelsOverNames=$preferCborLabelsOverNames, alwaysUseByteString=$alwaysUseByteString)"
}
}

0 comments on commit 167877b

Please sign in to comment.