package com.github.kahalemakai.opencsv.beans;

import com.opencsv.CSVReader;

import java.io.Closeable;
import java.io.IOException;
import java.util.Iterator;

public interface CsvToBeanMapper<T> extends Closeable, Iterable<BeanAccessor<T>> {
    CsvToBeanMapper<T> withReader(CSVReader reader) throws IOException;

    CsvToBeanMapper<T> withLines(Iterable<String[]> lines) throws IllegalStateException;

    default CsvToBeanMapper<T> withLines(Iterator<String[]> lines) {
        return withLines(() -> lines);
    }

    default void registerDecoder(String column, Decoder<?> decoder) { }

    Class<? extends T> getType();

    static <S> CsvToBeanMapperOfHeader<S> fromHeader(Class<? extends S> type) {
        return CsvToBeanMapperOfHeader.of(type, new HeaderDirectMappingStrategy<S>());
    }
}

@@ -522,73 +522,1476 @@
     
-default void registerDecoder(String column, Decoder%3C?%3E decoder) %7B
+// should be override by subclasses%0A    default CsvToBeanMapper%3CT%3E registerDecoder(String column, Decoder%3C?, ? extends Throwable%3E decoder) %7B%0A        return this;%0A    %7D%0A%0A    // should be override by subclasses%0A    default CsvToBeanMapper%3CT%3E registerDecoder(String column,%0A                                               Class%3C? extends Decoder%3C?, ? extends Throwable%3E%3E decoderClass) throws InstantiationException %7B%0A        return this;%0A    %7D%0A%0A    @SuppressWarnings(%22unchecked%22)%0A    default CsvToBeanMapper%3CT%3E registerDecoder(String column,%0A                                               Decoder%3C?, ? extends Throwable%3E decoder,%0A                                               Decoder%3C?, ? extends Throwable%3E...decoders) %7B%0A        registerDecoder(column, decoder);%0A        for (Decoder%3C?, ? extends Throwable%3E d : decoders) %7B%0A            registerDecoder(column, d);%0A        %7D%0A        return this;%0A    %7D%0A%0A    @SuppressWarnings(%22unchecked%22)%0A    default CsvToBeanMapper%3CT%3E registerDecoder(String column,%0A                                               Class%3C? extends Decoder%3C?, ? extends Throwable%3E%3E decoderClass,%0A                                               Class%3C? extends Decoder%3C?, ? extends Throwable%3E%3E...decoderClasses) throws InstantiationException %7B%0A        registerDecoder(column, decoderClass);%0A        for (Class%3C? extends Decoder%3C?, ? extends Throwable%3E%3E aClass : decoderClasses) %7B%0A            registerDecoder(column, aClass);%0A        %7D%0A        return this;%0A   
  %7D%0A%0A

add registerDecoder() methods to CsvToBeanMapper interface