Class BeanFieldJoinStringIndex<T>

  • Type Parameters:
    T - The type of the bean being populated
    All Implemented Interfaces:
    BeanField<T,​java.lang.String>

    public class BeanFieldJoinStringIndex<T>
    extends BeanFieldJoin<T,​java.lang.String>
    Implements a BeanFieldJoin with a String for an index.
    Since:
    4.2
    Author:
    Andrew Rucker Jones
    • Constructor Detail

      • BeanFieldJoinStringIndex

        public BeanFieldJoinStringIndex​(java.lang.Class<?> type,
                                        java.lang.reflect.Field field,
                                        boolean required,
                                        java.util.Locale errorLocale,
                                        CsvConverter converter,
                                        java.lang.Class<? extends org.apache.commons.collections4.MultiValuedMap> mapType,
                                        java.lang.String capture,
                                        java.lang.String format)
        Creates a new instance.
        Parameters:
        type - The type of the class in which this field is found. This is the type as instantiated by opencsv, and not necessarily the type in which the field is declared in the case of inheritance.
        field - The bean field this object represents
        required - Whether or not a value is always required for this field
        errorLocale - The locale to use for error messages
        converter - The converter to be used for performing the data conversion on reading or writing
        mapType - The type of the MultiValuedMap that should be instantiated for the bean field being populated
        capture - See CsvBindAndJoinByName.capture()
        format - The format string used for packaging values to be written. If null or empty, it is ignored.
    • Method Detail

      • putNewValue

        protected java.lang.Object putNewValue​(org.apache.commons.collections4.MultiValuedMap<java.lang.String,​java.lang.Object> map,
                                               java.lang.String index,
                                               java.lang.Object newValue)
        Description copied from class: BeanFieldJoin
        Puts the value given in newValue into map using index. This allows derived classes to do something special before assigning the value, such as converting the index to a different type.
        Specified by:
        putNewValue in class BeanFieldJoin<T,​java.lang.String>
        Parameters:
        map - The map to which to assign the new value. Never null.
        index - The index under which the new value should be placed in the map. Never null.
        newValue - The new value to be put in the map
        Returns:
        The previous value under this index, or null if there was no previous value