// Path: src/main/java/uk/elementarysoftware/quickcsv/api/CSVRecord.java
// public interface CSVRecord {
//     public void skipField();
//     public void skipFields(int nFields);
//     
//     public Field getNextField();
// }
// 
// Path: src/main/java/uk/elementarysoftware/quickcsv/api/CSVRecordWithHeader.java
// public interface CSVRecordWithHeader<K extends Enum<K>> {
//     
//     public Field getField(K field);
//     
//     public List<String> getHeader();
// }
// 
// Path: src/main/java/uk/elementarysoftware/quickcsv/api/Field.java
// public interface Field {
// 
//     public ByteBuffer raw();
// 
//     public String asString();
//     
//     public double asDouble();
//     public byte asByte();
//     public char asChar();
//     public short asShort();
//     public int asInt();
//     public long asLong();
//     
//     public Integer asBoxedInt();
//     public Double asBoxedDouble();
// 
//     public boolean isEmpty();
// 
//     public Field clone();
// }


import java.util.function.Function;
import uk.elementarysoftware.quickcsv.api.CSVRecord;
import uk.elementarysoftware.quickcsv.api.CSVRecordWithHeader;
import uk.elementarysoftware.quickcsv.api.Field;
    }
    
    public static class HeaderAwareMapper2 {
        public static enum Fields {
            AccentCity, Population, Latitude, Longitude, Country, City
        }
        
        public static final Function<CSVRecordWithHeader<Fields>, City> MAPPER = r -> {
            return new City(
                r.getField(Fields.City).asString(),
                r.getField(Fields.Population).asInt(),
                r.getField(Fields.Latitude).asDouble(),
                r.getField(Fields.Longitude).asDouble(),
                r.getField(Fields.Population).asLong()
            );
        };
    }
    
    private static final int CITY_INDEX = 2;
    
    private final String city;
    private final int population; 
    private final double latitude;
    private final double longitude;
    private final long populationL;
    
    public City(CSVRecord r) {
        r.skipFields(CITY_INDEX);
        this.city  = r.getNextField().asString();
        r.skipField();
// Path: src/main/java/uk/elementarysoftware/quickcsv/api/CSVRecord.java
// public interface CSVRecord {
//     public void skipField();
//     public void skipFields(int nFields);
//     
//     public Field getNextField();
// }
// 
// Path: src/main/java/uk/elementarysoftware/quickcsv/api/CSVRecordWithHeader.java
// public interface CSVRecordWithHeader<K extends Enum<K>> {
//     
//     public Field getField(K field);
//     
//     public List<String> getHeader();
// }
// 
// Path: src/main/java/uk/elementarysoftware/quickcsv/api/Field.java
// public interface Field {
// 
//     public ByteBuffer raw();
// 
//     public String asString();
//     
//     public double asDouble();
//     public byte asByte();
//     public char asChar();
//     public short asShort();
//     public int asInt();
//     public long asLong();
//     
//     public Integer asBoxedInt();
//     public Double asBoxedDouble();
// 
//     public boolean isEmpty();
// 
//     public Field clone();
// }


// Path: src/test/java/uk/elementarysoftware/quickcsv/sampledomain/City.java
import java.util.function.Function;
import uk.elementarysoftware.quickcsv.api.CSVRecord;
import uk.elementarysoftware.quickcsv.api.CSVRecordWithHeader;
import uk.elementarysoftware.quickcsv.api.Field;

    }
    
    public static class HeaderAwareMapper2 {
        public static enum Fields {
            AccentCity, Population, Latitude, Longitude, Country, City
        }
        
        public static final Function<CSVRecordWithHeader<Fields>, City> MAPPER = r -> {
            return new City(
                r.getField(Fields.City).asString(),
                r.getField(Fields.Population).asInt(),
                r.getField(Fields.Latitude).asDouble(),
                r.getField(Fields.Longitude).asDouble(),
                r.getField(Fields.Population).asLong()
            );
        };
    }
    
    private static final int CITY_INDEX = 2;
    
    private final String city;
    private final int population; 
    private final double latitude;
    private final double longitude;
    private final long populationL;
    
    public City(CSVRecord r) {
        r.skipFields(CITY_INDEX);
        this.city  = r.getNextField().asString();
        r.skipField();
        Field popField = r.getNextField();