Package com.opencsv.bean.customconverter
Class ConvertGermanToBoolean<T,I>
- java.lang.Object
-
- com.opencsv.bean.AbstractBeanField<T,I>
-
- com.opencsv.bean.customconverter.ConverterLanguageToBoolean<T,I>
-
- com.opencsv.bean.customconverter.ConvertGermanToBoolean<T,I>
-
- Type Parameters:
T
- Type of the bean to be manipulatedI
- Type of the index into multivalued fields
- All Implemented Interfaces:
BeanField<T,I>
public class ConvertGermanToBoolean<T,I> extends ConverterLanguageToBoolean<T,I>
This class converts common German representations of boolean values into aBoolean
. This class also demonstrates how to localize booleans for any other language.- Since:
- 3.8
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String
FALSCH
private static java.lang.String[]
FALSE_STRINGS
private static java.lang.String[]
TRUE_STRINGS
private static java.lang.String
WAHR
-
Fields inherited from class com.opencsv.bean.AbstractBeanField
converter, errorLocale, field, fieldAccess, required, type
-
-
Constructor Summary
Constructors Constructor Description ConvertGermanToBoolean()
Silence code style checker by adding a useless constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String[]
getAllLocalizedFalseValues()
This represents a list of all values accepted as "false".protected java.lang.String[]
getAllLocalizedTrueValues()
This represents a list of all values accepted as "true".protected java.lang.String
getLocalizedFalse()
This is the string for "false" in the localized language.protected java.lang.String
getLocalizedTrue()
This is the string for "true" in the localized language.-
Methods inherited from class com.opencsv.bean.customconverter.ConverterLanguageToBoolean
convert, convertToWrite
-
Methods inherited from class com.opencsv.bean.AbstractBeanField
assignValueToField, getErrorLocale, getField, getFieldValue, getType, indexAndSplitMultivaluedField, isFieldEmptyForWrite, isRequired, setErrorLocale, setField, setFieldValue, setRequired, setType, write
-
-
-
-
Field Detail
-
WAHR
private static final java.lang.String WAHR
- See Also:
- Constant Field Values
-
FALSCH
private static final java.lang.String FALSCH
- See Also:
- Constant Field Values
-
TRUE_STRINGS
private static final java.lang.String[] TRUE_STRINGS
-
FALSE_STRINGS
private static final java.lang.String[] FALSE_STRINGS
-
-
Method Detail
-
getLocalizedTrue
protected java.lang.String getLocalizedTrue()
Description copied from class:ConverterLanguageToBoolean
This is the string for "true" in the localized language. This value will be used on converting from a boolean to a string.- Specified by:
getLocalizedTrue
in classConverterLanguageToBoolean<T,I>
- Returns:
- The canonical name of
true
in this language
-
getLocalizedFalse
protected java.lang.String getLocalizedFalse()
Description copied from class:ConverterLanguageToBoolean
This is the string for "false" in the localized language. This value will be used on converting from a boolean to a string.- Specified by:
getLocalizedFalse
in classConverterLanguageToBoolean<T,I>
- Returns:
- The canonical name of
false
in this language
-
getAllLocalizedTrueValues
protected java.lang.String[] getAllLocalizedTrueValues()
Description copied from class:ConverterLanguageToBoolean
This represents a list of all values accepted as "true". Any language will have more than one way to say "true", such as "yes", "y", or "1". This array should list all possibilities. Comparison is done in a case-insensitive fashion.- Specified by:
getAllLocalizedTrueValues
in classConverterLanguageToBoolean<T,I>
- Returns:
- An array of all "true" strings
-
getAllLocalizedFalseValues
protected java.lang.String[] getAllLocalizedFalseValues()
Description copied from class:ConverterLanguageToBoolean
This represents a list of all values accepted as "false". Any language will have more than one way to say "false", such as "no", "n", or "0". This array should list all possibilities. Comparison is done in a case-insensitive fashion.- Specified by:
getAllLocalizedFalseValues
in classConverterLanguageToBoolean<T,I>
- Returns:
- An array of all "false" strings
-
-