package com.capgemini.reports.definition.r07report.data.filter.comparators.part;

import com.capgemini.reports.bomlineholder.BOMLineHolder;
import com.capgemini.reports.snecmaobjects.ISnecmaObject;
import com.capgemini.reports.snecmaobjects.part.PartNoAeroRevision;

/**
 * Compares two {@link PartNoAeroRevision}'s {@link BOMLineHolder}s.
 */
public class PartNoAeroComparator extends PartComparator {
    private static final long serialVersionUID = -1728487703112167469L;

    @Override
    public int compare(final ISnecmaObject thisPart, final ISnecmaObject otherPart) {
        int cmp = super.compare(thisPart, otherPart);
        if (cmp != 0) {
            return cmp;
        }
        PartNoAeroRevision thisPartNoAero = (PartNoAeroRevision) thisPart;
        PartNoAeroRevision otherPartNoAero = (PartNoAeroRevision) otherPart;
        cmp = thisPartNoAero.getTypeNoAero().compareTo(otherPartNoAero.getTypeNoAero());
        return cmp;
    }
}
