Class StringConverterWithFormat<T>

  • Type Parameters:
    T -

    public abstract class StringConverterWithFormat<T>
    extends StringConverter<T>
    This class is used by some of the SpreadsheetCellType in order to use a specific format.
    Since the format is specified in the SpreadsheetCell, we need a converter which provide a runtime method toStringFormat(Object, String).
    This class provide two constructors:
    • A default one where you implement the three abstract methods.
    • Another one which takes another StringConverter. This is useful when you just want to implement the toStringFormat(Object, String) and let the other converter handle the other methods.
    See Also:
    SpreadsheetCellType
    • Constructor Detail

      • StringConverterWithFormat

        public StringConverterWithFormat()
        Default constructor.
      • StringConverterWithFormat

        public StringConverterWithFormat​(StringConverter<T> specificStringConverter)
        This constructor allow to use another StringConverter.
        Parameters:
        specificStringConverter -
    • Method Detail

      • toStringFormat

        public String toStringFormat​(T value,
                                     String format)
        Converts the object provided into its string form with the specified format.
        Parameters:
        value -
        format -
        Returns:
        a string containing the converted value with the specified format.