Class StringConverter


  • public abstract class StringConverter
    extends java.lang.Object
    This is the base class for all converter classes which transform a string into another string. This can be a converter ignoring white spaces or a converter transforming all strings to upper case.

    This class can be uses as addtional parameter for the FileTester or IOTester class in the junit package.

    Since:
    1.6 (03.08.2015)
    Author:
    oliver (boehm@javatux.de)
    • Field Detail

      • ECHO

        public static final StringConverter ECHO
        This converter echoes only the input string.
      • UPPER_CASE

        public static final StringConverter UPPER_CASE
        Use this converter if you want to convert the string into upper case.
      • LOWER_CASE

        public static final StringConverter LOWER_CASE
        Use this converter if you want to convert the string into lower case.
      • IGNORE_WHITESPACES

        public static final StringConverter IGNORE_WHITESPACES
        Use this converter if you want to ignore white spaces.
    • Constructor Detail

      • StringConverter

        public StringConverter()
    • Method Detail

      • convert

        public abstract java.lang.String convert​(java.lang.String input)
        This is the method for conversion.
        Parameters:
        input - the input
        Returns:
        the string
      • and

        public final StringConverter and​(StringConverter... others)
        With this method you can combine several converters.
        Parameters:
        others - the other converters
        Returns:
        the string converter