クラス KotlinSerializationProtobufDecoder
java.lang.ObjectSE
org.springframework.http.codec.KotlinSerializationSupport<kotlinx.serialization.protobuf.ProtoBuf>
org.springframework.http.codec.KotlinSerializationBinaryDecoder<kotlinx.serialization.protobuf.ProtoBuf>
org.springframework.http.codec.protobuf.KotlinSerializationProtobufDecoder
public class KotlinSerializationProtobufDecoder
extends KotlinSerializationBinaryDecoder<kotlinx.serialization.protobuf.ProtoBuf>
バイトストリームをプロトコルバッファーにデコードし、kotlinx.serialization を使用してオブジェクトに変換します。
application/x-protobuf、application/octet-stream、application/vnd.google.protobuf をサポートします。As of Spring Framework 7.0, by default it only decodes types annotated with @Serializable at type or generics level.
この動作をカスタマイズするには、Predicate<ResolvableType> パラメーターを持つ代替コンストラクターを使用できます。例: new KotlinSerializationProtobufDecoder(type -> true) は、アノテーションなしの Kotlin 列挙、数値、文字、ブール値、文字列など、Kotlin 直列化でサポートされているすべての型をデコードします。
ストリームのデコードはまだサポートされていません。kotlinx.serialization/issues/1073 関連の課題を参照してください。
- 導入:
- 6.0
- 作成者:
- Iain Henderson, Sebastien Deleuze
- 関連事項:
コンストラクターの概要
コンストラクターコンストラクター説明Construct a new decoder usingProtoBuf.Defaultinstance which only decodes types annotated with@Serializableat type or generics level.KotlinSerializationProtobufDecoder(PredicateSE<ResolvableType> typePredicate) Construct a new decoder usingProtoBuf.Defaultinstance which only decodes types for which the specified predicate returnstrue.KotlinSerializationProtobufDecoder(kotlinx.serialization.protobuf.ProtoBuf protobuf) Construct a new decoder using the providedProtoBufinstance which only decodes types annotated with@Serializableat type or generics level.KotlinSerializationProtobufDecoder(kotlinx.serialization.protobuf.ProtoBuf protobuf, PredicateSE<ResolvableType> typePredicate) Construct a new decoder using the providedProtoBufinstance which only decodes types for which the specified predicate returnstrue.メソッドのサマリー
クラス KotlinSerializationBinaryDecoder から継承されたメソッド
canDecode, decode, decodeToMono, getDecodableMimeTypes, getDecodableMimeTypes, getMaxInMemorySize, setMaxInMemorySizeクラス KotlinSerializationSupport から継承されたメソッド
canSerialize, format, serializer, supportedMimeTypes
コンストラクターの詳細
KotlinSerializationProtobufDecoder
public KotlinSerializationProtobufDecoder()Construct a new decoder usingProtoBuf.Defaultinstance which only decodes types annotated with@Serializableat type or generics level.KotlinSerializationProtobufDecoder
Construct a new decoder usingProtoBuf.Defaultinstance which only decodes types for which the specified predicate returnstrue.- 導入:
- 7.0
KotlinSerializationProtobufDecoder
public KotlinSerializationProtobufDecoder(kotlinx.serialization.protobuf.ProtoBuf protobuf) Construct a new decoder using the providedProtoBufinstance which only decodes types annotated with@Serializableat type or generics level.KotlinSerializationProtobufDecoder
public KotlinSerializationProtobufDecoder(kotlinx.serialization.protobuf.ProtoBuf protobuf, PredicateSE<ResolvableType> typePredicate) Construct a new decoder using the providedProtoBufinstance which only decodes types for which the specified predicate returnstrue.- 導入:
- 7.0