package <%= packageName %>.config.dbmigrations;

import org.supercsv.cellprocessor.CellProcessorAdaptor;
import org.supercsv.cellprocessor.ift.*;
import org.supercsv.util.CsvContext;

public class StrNULLTonull
    extends CellProcessorAdaptor
    implements BoolCellProcessor, DateCellProcessor, DoubleCellProcessor, LongCellProcessor, StringCellProcessor {
    public StrNULLTonull() {
    }

    public StrNULLTonull(StringCellProcessor next) {
        super(next);
    }

    public Object execute(Object value, CsvContext context) {
        this.validateInputNotNull(value, context);
        if (value instanceof String && value.equals("NULL")) {
            return this.next.execute(null, context);
        } else {
            return this.next.execute(value, context);
        }
    }
}
