Class ParseStringDeserializer<T>
java.lang.Object
org.springframework.kafka.support.serializer.ParseStringDeserializer<T>
- Type Parameters:
- T- class of the entity, representing messages
- All Implemented Interfaces:
- Closeable,- AutoCloseable,- org.apache.kafka.common.serialization.Deserializer<T>
- 
Field SummaryFields
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct an instance with no parser function; a static method name must be provided in the consumer configKEY_PARSERorVALUE_PARSERproperties.ParseStringDeserializer(BiFunction<String, org.apache.kafka.common.header.Headers, T> parser) Construct an instance with the supplied parser function.ParseStringDeserializer(Function<String, T> parser) Construct an instance with the supplied parser function.
- 
Method SummaryModifier and TypeMethodDescriptionvoiddeserialize(String topic, byte[] data) deserialize(String topic, org.apache.kafka.common.header.Headers headers, byte[] data) deserialize(String topic, org.apache.kafka.common.header.Headers headers, ByteBuffer data) Get the configured charset.BiFunction<String, org.apache.kafka.common.header.Headers, T> Get the configured parser function.voidsetCharset(Charset charset) Set a charset to use when converting byte[] toString.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.common.serialization.Deserializerclose
- 
Field Details- 
KEY_PARSER
- 
VALUE_PARSER
 
- 
- 
Constructor Details- 
ParseStringDeserializerpublic ParseStringDeserializer()Construct an instance with no parser function; a static method name must be provided in the consumer configKEY_PARSERorVALUE_PARSERproperties.
- 
ParseStringDeserializer
- 
ParseStringDeserializerpublic ParseStringDeserializer(BiFunction<String, org.apache.kafka.common.header.Headers, T> parser) Construct an instance with the supplied parser function. The function may receive null as the input value, for example for a tombstone record in a compacted topic.- Parameters:
- parser- the function.
 
 
- 
- 
Method Details- 
configure
- 
deserialize
- 
deserialize
- 
deserialize- Specified by:
- deserializein interface- org.apache.kafka.common.serialization.Deserializer<T>
 
- 
setCharset
- 
getCharset
- 
getParserGet the configured parser function.- Returns:
- the function.
 
 
-