package ru.yandex.webmaster3.core.semantic.semantic_document_parser.rdfa.exceptions;

import java.util.Comparator;

/**
 * Created by aleksart on 30.03.15.
 */
public class RDFaExceptionComparator implements Comparator {

    @Override
    public int compare(Object o1, Object o2) {
        if(o1 instanceof RDFaException && o2 instanceof RDFaException){
            RDFaException e1 = (RDFaException) o1;
            RDFaException e2 = (RDFaException) o2;
            if(e1.getHash() == e2.getHash()){
                if(e1.getMessage().equals(e2.getMessage())){
                    return 0;
                }
            }
        }
        return 1;
    }
}
