Package patterntesting.runtime.util
Class StringConverter
- java.lang.Object
-
- patterntesting.runtime.util.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 Summary
Fields Modifier and Type Field Description static StringConverter
ECHO
This converter echoes only the input string.static StringConverter
IGNORE_WHITESPACES
Use this converter if you want to ignore white spaces.static StringConverter
LOWER_CASE
Use this converter if you want to convert the string into lower case.static StringConverter
UPPER_CASE
Use this converter if you want to convert the string into upper case.
-
Constructor Summary
Constructors Constructor Description StringConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringConverter
and(StringConverter... others)
With this method you can combine several converters.abstract java.lang.String
convert(java.lang.String input)
This is the method for conversion.
-
-
-
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.
-
-
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
-
-