org.apache.kafka.common.serialization
Class StringDeserializer

java.lang.Object
  extended by org.apache.kafka.common.serialization.StringDeserializer
All Implemented Interfaces:
Deserializer<java.lang.String>

public class StringDeserializer
extends java.lang.Object
implements Deserializer<java.lang.String>

String encoding defaults to UTF8 and can be customized by setting the property key.deserializer.encoding, value.deserializer.encoding or deserializer.encoding. The first two take precedence over the last.


Constructor Summary
StringDeserializer()
           
 
Method Summary
 void close()
          Close this deserializer
 void configure(java.util.Map<java.lang.String,?> configs, boolean isKey)
          Configure this class.
 java.lang.String deserialize(java.lang.String topic, byte[] data)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringDeserializer

public StringDeserializer()
Method Detail

configure

public void configure(java.util.Map<java.lang.String,?> configs,
                      boolean isKey)
Description copied from interface: Deserializer
Configure this class.

Specified by:
configure in interface Deserializer<java.lang.String>
Parameters:
configs - configs in key/value pairs
isKey - whether is for key or value

deserialize

public java.lang.String deserialize(java.lang.String topic,
                                    byte[] data)
Specified by:
deserialize in interface Deserializer<java.lang.String>
Parameters:
topic - topic associated with the data
data - serialized bytes
Returns:
deserialized object

close

public void close()
Description copied from interface: Deserializer
Close this deserializer

Specified by:
close in interface Deserializer<java.lang.String>