public Field[] getFieldsFromFieldHeaders(String[] headers, SQLErrorStorage errorStorage) {
        Field[] fields = new Field[headers.length];
        Set<String> fieldsSeen = new HashSet<>();
        for (int h = 0; h < headers.length; h++) {
            String header = sanitize(headers[h], errorStorage);
            if (fieldsSeen.contains(header) || "id".equals(header)) {
                // FIXME: add separate error for tables containing ID field.
                if (errorStorage != null) errorStorage.storeError(NewGTFSError.forTable(this, DUPLICATE_HEADER).setBadValue(header));
                fields[h] = null;
            } else {
                fields[h] = getFieldForName(header);
                fieldsSeen.add(header);
            }
        }
        return fields;
    }
public Field[] getFieldsFromFieldHeaders(String[] headers, SQLErrorStorage errorStorage) {
        Field[] fields = new Field[headers.length];
        Set<String> fieldsSeen = new HashSet<>();
        for (int h = 0; h < headers.length; h++) {
            String header = sanitize(headers[h], errorStorage);
            if (fieldsSeen.contains(header) || "id".equals(header)) {
                
                if (errorStorage != null) errorStorage.storeError(NewGTFSError.forTable(this, DUPLICATE_HEADER).setBadValue(header));
                fields[h] = null;
            } else {
                fields[h] = getFieldForName(header);
                fieldsSeen.add(header);
            }
        }
        return fields;
    }
public Field [ ] getFieldsFromFieldHeaders ( String [ ] headers , SQLErrorStorage errorStorage ) { Field [ ] fields = new Field [ headers . length ] ; Set < String > fieldsSeen = new HashSet <> ( ) ; for ( int h = 0 ; h < headers . length ; h ++ ) { String header = sanitize ( headers [ h ] , errorStorage ) ; if ( fieldsSeen . contains ( header ) || "id" . equals ( header ) ) { // FIXME: add separate error for tables containing ID field. if ( errorStorage != null ) errorStorage . storeError ( NewGTFSError . forTable ( this , DUPLICATE_HEADER ) . setBadValue ( header ) ) ; fields [ h ] = null ; } else { fields [ h ] = getFieldForName ( header ) ; fieldsSeen . add ( header ) ; } } return fields ; }
For an array of field headers, returns the matching set of {@link Field}s for a {@link Table}. If errorStorage is
not null, errors related to unexpected or duplicate header names will be stored.
For an array of field headers returns the matching set of {