@PublicEvolving public final class SimpleVersionedStringSerializer extends Object implements SimpleVersionedSerializer<String>
SimpleVersionedSerializer
implementation for Strings.Modifier and Type | Field and Description |
---|---|
static SimpleVersionedStringSerializer |
INSTANCE |
Modifier and Type | Method and Description |
---|---|
String |
deserialize(int version,
byte[] serialized)
De-serializes the given data (bytes) which was serialized with the scheme of the indicated
version.
|
int |
getVersion()
Gets the version with which this serializer serializes.
|
byte[] |
serialize(String value)
Serializes the given object.
|
public static final SimpleVersionedStringSerializer INSTANCE
public int getVersion()
SimpleVersionedSerializer
getVersion
in interface SimpleVersionedSerializer<String>
getVersion
in interface Versioned
public byte[] serialize(String value)
SimpleVersionedSerializer
SimpleVersionedSerializer.getVersion()
.serialize
in interface SimpleVersionedSerializer<String>
value
- The object to serialize.public String deserialize(int version, byte[] serialized) throws IOException
SimpleVersionedSerializer
deserialize
in interface SimpleVersionedSerializer<String>
version
- The version in which the data was serializedserialized
- The serialized dataIOException
- Thrown, if the deserialization fails.Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.