Interface SpecificTextSerializer<T>

    • Method Summary

      All Methods Instance Methods Default Methods 
      Modifier and Type Method Description
      default T deserialize​(String text)
      Deserialize a value from text that has been created with the corresponding serializer, where the value does not have a unit, and the class is known and fixed (and not checked).
      default String serialize​(T value)
      Serialize a value to text in such a way that it can be deserialized with the corresponding deserializer.
    • Method Detail

      • serialize

        default String serialize​(T value)
        Serialize a value to text in such a way that it can be deserialized with the corresponding deserializer. Note that null values for value are allowed. A null values stands for an empty column value in a CVS-file, a missing tag in an XML-file, etc. This version of the serialize method ignores the unit.
        Parameters:
        value - T; the value to serialize, may be null
        Returns:
        String; a string representation of the value that can later be deserialized, or nullto denote a missing value
      • deserialize

        default T deserialize​(String text)
        Deserialize a value from text that has been created with the corresponding serializer, where the value does not have a unit, and the class is known and fixed (and not checked). Note that null values for text are allowed. A null values stands for an empty column value in a CVS-file, a missing tag in an XML-file, etc. In this way, we can explicitly show values that were not specified in the file.
        Parameters:
        text - String; the string to deserialize, may be null
        Returns:
        T; an instance of the object created with the corresponding serializer, may be null when a value was not specified in the source from which the deserializer was called