Class SimpleStringSchema

    • Constructor Detail

      • SimpleStringSchema

        public SimpleStringSchema()
        Creates a new SimpleStringSchema that uses "UTF-8" as the encoding.
      • SimpleStringSchema

        public SimpleStringSchema​(Charset charset)
        Creates a new SimpleStringSchema that uses the given charset to convert between strings and bytes.
        Parameters:
        charset - The charset to use to convert between strings and bytes.
    • Method Detail

      • getCharset

        public Charset getCharset()
        Gets the charset used by this schema for serialization.
        Returns:
        The charset used by this schema for serialization.
      • deserialize

        public String deserialize​(byte[] message)
        Description copied from interface: DeserializationSchema
        Deserializes the byte message.
        Specified by:
        deserialize in interface DeserializationSchema<String>
        Parameters:
        message - The message, as a byte array.
        Returns:
        The deserialized message as an object (null if the message cannot be deserialized).
      • isEndOfStream

        public boolean isEndOfStream​(String nextElement)
        Description copied from interface: DeserializationSchema
        Method to decide whether the element signals the end of the stream. If true is returned the element won't be emitted.
        Specified by:
        isEndOfStream in interface DeserializationSchema<String>
        Parameters:
        nextElement - The element to test for the end-of-stream signal.
        Returns:
        True, if the element signals end of stream, false otherwise.
      • serialize

        public byte[] serialize​(String element)
        Description copied from interface: SerializationSchema
        Serializes the incoming element to a specified type.
        Specified by:
        serialize in interface SerializationSchema<String>
        Parameters:
        element - The incoming element to be serialized
        Returns:
        The serialized element.