package com.capgemini.reports.definition.r10report.lines;

import com.capgemini.reports.bomlineholder.BOMLineHolder;
import com.capgemini.reports.bomlineholder.flattener.line.AbstractAltPart;
import com.capgemini.reports.definition.r10report.DocumentExtractor;
import com.capgemini.reports.definition.r10report.R10Keys;
import com.capgemini.reports.snecmaobjects.part.AbstractPart;
import lombok.Getter;

import java.util.List;
import java.util.Map;

/**
 * Represents The link between an Alt and a Part in its pseudo-folder.
 */
@Getter
public class R10AltPart extends AbstractAltPart<List<Map<R10Keys, String>>, DocumentExtractor> {

    /**
     * builds the link between an Altenrate and a Part in its pseudo-folder.
     *
     * @param alt     the Alternate
     * @param child   the child part
     * @param counter the position of this line in the nomenclature.
     */
    public R10AltPart(final BOMLineHolder alt, final AbstractPart child, final int counter) {
        super(alt, child, counter);
    }

    @Override
    public List<Map<R10Keys, String>> transform(final DocumentExtractor extractor) {
        return extractor.extract(this);
    }

}
