package com.capgemini.reports.definition.r07report.data.extractor.lines;

import com.capgemini.framework.teamcenter.authent.TcSession;
import com.capgemini.reports.bomlineholder.BOMLineHolder;
import com.capgemini.reports.bomlineholder.flattener.line.AbstractReceptorLine;
import com.capgemini.reports.definition.r07report.data.TransformerR07;
import com.capgemini.reports.definition.r07report.data.filter.comparators.AbstractBomLineComparator;

/**
 * Represents a Receptor whose Repere does ot have a Component.
 */
public class R07ReceptorLine extends AbstractReceptorLine<String, TransformerR07> implements ComparableLine {


    /**
     * Builds a Receptor whose Repere does ot have a Component.
     *
     * @param recepteurBL       the bom line holder of the receptor
     * @param repereRecepteurBL the bom line holder of the repere
     * @param counter           the position of the line in the nomenclature
     */
    public R07ReceptorLine(final TcSession session, final BOMLineHolder recepteurBL, final BOMLineHolder repereRecepteurBL, final int counter) {
        super(session, recepteurBL, repereRecepteurBL, counter);
    }

    @Override
    public String transform(final TransformerR07 transformer) {
        return transformer.makeIdentifier(this);
    }

    @Override
    public int compareLineContent(final ComparableLine other) {
        return other.compareContent(this);
    }

    @Override
    public int compareContent(final R07Quad other) {
        return 1;
    }

    @Override
    public int compareContent(final R07PartRfPart other) {
        return 1;
    }

    @Override
    public int compareContent(final R07ReceptorLine other) {
        return AbstractBomLineComparator.compareReceptors(this.getRecepteurBL(), other.getRecepteurBL());
    }

    @Override
    public int compareContent(final R07ProductGeneric other) {
        return 1;
    }

    @Override
    public int compareContent(final R07AltPart other) {
        return 1;
    }
}
