package com.tofly.ghrq_route.module.trouble.domain;

import java.util.Arrays;
import java.util.Comparator;
import java.util.List;

/**
 * Created by Amu on 2017/9/13.
 */
public class PictureFileTypeSort implements Comparator<TroublePictureBean> {
    String[] repairTypes;

    public PictureFileTypeSort(String[] repairTypes) {
        this.repairTypes = repairTypes;
    }

    @Override
    public int compare(TroublePictureBean arg0, TroublePictureBean arg1) {
        List<String> fileTypeList = Arrays.asList(repairTypes);
        int index0 = fileTypeList.indexOf(arg0.getFiletype());
        int index1 = fileTypeList.indexOf(arg1.getFiletype());
        return index0 - index1;
    }
}
