public class Protobuf
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
APPLICATION_JSON |
static java.lang.String |
APPLICATION_PROTOBUF |
static java.lang.String |
APPLICATION_X_PROTOBUF |
Constructor and Description |
---|
Protobuf() |
Modifier and Type | Method and Description |
---|---|
static <T extends com.google.protobuf.MessageLite> |
binaryDeserializer(com.google.protobuf.Parser<T> parser)
Get a
Deserializer which can deserialize cloudevents with Protobuf payload using binary
encoding. |
static <T extends com.google.protobuf.MessageLite> |
binarySerializer()
Get a
Serializer which can serialize cloudevents with Protobuf payload using binary
encoding. |
static java.lang.String |
contentType(java.lang.String encoding)
Get content type based on encoding
|
static <T extends com.google.protobuf.MessageLite> |
deserializer(java.lang.String encoding,
java.lang.Class<T> clazz,
com.google.protobuf.Parser<T> parser) |
static <T extends com.google.protobuf.MessageLite> |
structuredDeserializer(java.lang.Class<T> typeParameterClass)
Get a
Deserializer which can serialize cloudevents with Protobuf payload using
structured encoding. |
static <T extends com.google.protobuf.MessageLite> |
structuredSerializer()
Get a
Serializer which can serialize cloudevents with Protobuf payload using
structured encoding. |
public static final java.lang.String APPLICATION_X_PROTOBUF
public static final java.lang.String APPLICATION_PROTOBUF
public static final java.lang.String APPLICATION_JSON
public static <T extends com.google.protobuf.MessageLite> Serializer<T> binarySerializer()
Serializer
which can serialize cloudevents with Protobuf payload using binary
encoding.
https://github.com/cloudevents/spec/blob/v1.0/kafka-protocol-binding.md#32-binary-content-modeBinarySerializer
public static <T extends com.google.protobuf.MessageLite> Deserializer<T> binaryDeserializer(com.google.protobuf.Parser<T> parser)
Deserializer
which can deserialize cloudevents with Protobuf payload using binary
encoding.
https://github.com/cloudevents/spec/blob/v1.0/kafka-protocol-binding.md#32-binary-content-modeBinaryDeserializer
public static <T extends com.google.protobuf.MessageLite> Serializer<T> structuredSerializer()
Serializer
which can serialize cloudevents with Protobuf payload using
structured encoding.
https://github.com/cloudevents/spec/blob/v1.0/kafka-protocol-binding.md#33-structured-content-modeStructuredSerializer
public static <T extends com.google.protobuf.MessageLite> Deserializer<T> structuredDeserializer(java.lang.Class<T> typeParameterClass)
Deserializer
which can serialize cloudevents with Protobuf payload using
structured encoding.
https://github.com/cloudevents/spec/blob/v1.0/kafka-protocol-binding.md#33-structured-content-modeStructuredDeserializer
public static java.lang.String contentType(java.lang.String encoding)
encoding
- (Either structured or binary)public static <T extends com.google.protobuf.MessageLite> Deserializer<T> deserializer(java.lang.String encoding, java.lang.Class<T> clazz, com.google.protobuf.Parser<T> parser)