package jp.agentec.abook.abv.bl.dto.comparator;

import java.util.Comparator;

import jp.agentec.abook.abv.bl.dto.OperationGroupMasterDto;

/**
 * Created by leej on 2019/06/28.
 */

public class OperationGroupMasterLevelComparator implements Comparator<OperationGroupMasterDto> {
    @Override
    public int compare(OperationGroupMasterDto dto1, OperationGroupMasterDto dto2) {
        int operationGroupMasterLevel1 = dto1.operationGroupMasterLevel;
        int operationGroupMasterLevel2 = dto2.operationGroupMasterLevel;
        int result;
        if (operationGroupMasterLevel1 > operationGroupMasterLevel2) {
            result = 1;
        } else if(operationGroupMasterLevel1 == operationGroupMasterLevel2) {
            result = 0;
        } else {
            result = -1;
        }
        return result;
    }
}