Package com.opencsv.bean.customconverter
Class ConvertFrenchToBoolean<T,I>
- java.lang.Object
-
- com.opencsv.bean.AbstractBeanField<T,I>
-
- com.opencsv.bean.customconverter.ConverterLanguageToBoolean<T,I>
-
- com.opencsv.bean.customconverter.ConvertFrenchToBoolean<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 ConvertFrenchToBoolean<T,I> extends ConverterLanguageToBoolean<T,I>
This class converts common French representations of boolean values into aBoolean
. This class also demonstrates how to localize booleans for any other language.- Since:
- 5.4
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.String[]
FALSE_STRINGS
private static java.lang.String
FAUX
private static java.lang.String[]
TRUE_STRINGS
private static java.lang.String
VRAI
-
Fields inherited from class com.opencsv.bean.AbstractBeanField
converter, errorLocale, field, fieldAccess, required, type
-
-
Constructor Summary
Constructors Constructor Description ConvertFrenchToBoolean()
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
-
VRAI
private static final java.lang.String VRAI
- See Also:
- Constant Field Values
-
FAUX
private static final java.lang.String FAUX
- 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
-
-