org.apache.kafka.common.serialization
Class StringDeserializer
java.lang.Object
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.
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 |
StringDeserializer
public StringDeserializer()
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 pairsisKey
- 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 datadata
- 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>