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>
This class converts common French representations of boolean values into a
Boolean
.
This class also demonstrates how to localize booleans for any other language.- Since:
- 5.4
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String[]
private static final String
private static final String[]
private static final String
Fields inherited from class com.opencsv.bean.AbstractBeanField
converter, errorLocale, field, fieldAccess, required, type
-
Constructor Summary
ConstructorsConstructorDescriptionSilence code style checker by adding a useless constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected String[]
This represents a list of all values accepted as "false".protected String[]
This represents a list of all values accepted as "true".protected String
This is the string for "false" in the localized language.protected String
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 Details
-
VRAI
- See Also:
-
FAUX
- See Also:
-
TRUE_STRINGS
-
FALSE_STRINGS
-
-
Constructor Details
-
ConvertFrenchToBoolean
public ConvertFrenchToBoolean()Silence code style checker by adding a useless constructor.
-
-
Method Details
-
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
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
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
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
-