@PublicEvolving public class SimpleStringSchema extends Object implements DeserializationSchema<String>, SerializationSchema<String>
By default, the serializer uses "UTF-8" for string/byte conversion.
DeserializationSchema.InitializationContext
SerializationSchema.InitializationContext
Constructor and Description |
---|
SimpleStringSchema()
Creates a new SimpleStringSchema that uses "UTF-8" as the encoding.
|
SimpleStringSchema(Charset charset)
Creates a new SimpleStringSchema that uses the given charset to convert between strings and
bytes.
|
Modifier and Type | Method and Description |
---|---|
String |
deserialize(byte[] message)
Deserializes the byte message.
|
Charset |
getCharset()
Gets the charset used by this schema for serialization.
|
TypeInformation<String> |
getProducedType()
Gets the data type (as a
TypeInformation ) produced by this function or input format. |
boolean |
isEndOfStream(String nextElement)
Method to decide whether the element signals the end of the stream.
|
byte[] |
serialize(String element)
Serializes the incoming element to a specified type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
deserialize, open
open
public SimpleStringSchema()
public SimpleStringSchema(Charset charset)
charset
- The charset to use to convert between strings and bytes.public Charset getCharset()
public String deserialize(byte[] message)
DeserializationSchema
deserialize
in interface DeserializationSchema<String>
message
- The message, as a byte array.public boolean isEndOfStream(String nextElement)
DeserializationSchema
isEndOfStream
in interface DeserializationSchema<String>
nextElement
- The element to test for the end-of-stream signal.public byte[] serialize(String element)
SerializationSchema
serialize
in interface SerializationSchema<String>
element
- The incoming element to be serializedpublic TypeInformation<String> getProducedType()
ResultTypeQueryable
TypeInformation
) produced by this function or input format.getProducedType
in interface ResultTypeQueryable<String>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.