Class AbstractSerializableValueSerializer<T extends SerializableValue>

    • Field Detail

      • serializationDataFormat

        protected String serializationDataFormat
    • Constructor Detail

      • AbstractSerializableValueSerializer

        public AbstractSerializableValueSerializer​(SerializableValueType type,
                                                   String serializationDataFormat)
    • Method Detail

      • createDeserializedValue

        protected abstract T createDeserializedValue​(Object deserializedObject,
                                                     String serializedStringValue,
                                                     ValueFields valueFields,
                                                     boolean asTransientValue)
      • createSerializedValue

        protected abstract T createSerializedValue​(String serializedStringValue,
                                                   ValueFields valueFields,
                                                   boolean asTransientValue)
      • writeToValueFields

        protected abstract void writeToValueFields​(T value,
                                                   ValueFields valueFields,
                                                   byte[] serializedValue)
      • updateTypedValue

        protected abstract void updateTypedValue​(T value,
                                                 String serializedStringValue)
      • readSerializedValueFromFields

        protected byte[] readSerializedValueFromFields​(ValueFields valueFields)
      • getSerializedStringValue

        protected String getSerializedStringValue​(byte[] serializedByteValue)
      • getSerializedBytesValue

        protected byte[] getSerializedBytesValue​(String serializedStringValue)
      • canSerializeValue

        protected abstract boolean canSerializeValue​(Object value)
        return true if this serializer is able to serialize the provided object.
        Parameters:
        value - the object to test (guaranteed to be a non-null value)
        Returns:
        true if the serializer can handle the object.
      • serializeToByteArray

        protected abstract byte[] serializeToByteArray​(Object deserializedObject)
                                                throws Exception
        Implementations must return a byte[] representation of the provided object. The object is guaranteed not to be null.
        Parameters:
        deserializedObject - the object to serialize
        Returns:
        the byte array value of the object
        Throws:
        exception - in case the object cannot be serialized
        Exception
      • deserializeFromByteArray

        protected abstract Object deserializeFromByteArray​(byte[] object,
                                                           ValueFields valueFields)
                                                    throws Exception
        Deserialize the object from a byte array.
        Parameters:
        object - the object to deserialize
        valueFields - the value fields
        Returns:
        the deserialized object
        Throws:
        exception - in case the object cannot be deserialized
        Exception
      • isSerializationTextBased

        protected abstract boolean isSerializationTextBased()
        Return true if the serialization is text based. Return false otherwise