Class ConvertGermanToBoolean<T,​I>

  • Type Parameters:
    T - Type of the bean to be manipulated
    I - Type of the index into multivalued fields
    All Implemented Interfaces:
    BeanField<T,​I>

    public class ConvertGermanToBoolean<T,​I>
    extends AbstractBeanField<T,​I>
    This class converts common German representations of boolean values into a Boolean. This class also demonstrates how to localize booleans for any other language.
    Since:
    3.8
    Author:
    Andrew Rucker Jones
    • Constructor Detail

      • ConvertGermanToBoolean

        public ConvertGermanToBoolean()
        Silence code style checker by adding a useless constructor.
    • Method Detail

      • convert

        protected java.lang.Object convert​(java.lang.String value)
                                    throws CsvDataTypeMismatchException
        Converts German text into a Boolean. The comparisons are case-insensitive. The recognized pairs are wahr/falsch, w/f, ja/nein, j/n, 1/0.
        Specified by:
        convert in class AbstractBeanField<T,​I>
        Parameters:
        value - String that should represent a Boolean
        Returns:
        Boolean
        Throws:
        CsvDataTypeMismatchException - If anything other than the explicitly translated pairs is found