package com.capgemini.framework.teamcenter.object.runtime;

import com.capgemini.framework.teamcenter.object.pom.workspace.bom.TcBomObject;
import com.teamcenter.services.strong.cad._2013_05.StructureManagement.CreateWindowsInfo2;
import com.teamcenter.soa.client.model.strong.PSBOMView;

public class TcBomWindowConfiguration {
    private final TcBomObject topLineObject;
    private final PSBOMView bomview;
    private final TcRevisionRulesConfiguration tcRevisionRulesConfiguration;

    public TcBomWindowConfiguration(final TcBomObject topLineObject, final TcRevisionRulesConfiguration tcRevisionRulesConfiguration) {
        this(topLineObject, null, tcRevisionRulesConfiguration);
    }

    public TcBomWindowConfiguration(final TcBomObject topLineObject, final PSBOMView bomview, final TcRevisionRulesConfiguration tcRevisionRulesConfiguration) {
        this.topLineObject = topLineObject;
        this.bomview = bomview;
        this.tcRevisionRulesConfiguration = tcRevisionRulesConfiguration;
    }

    public CreateWindowsInfo2[] toTcInfo() {
        CreateWindowsInfo2[] createBOMWindowsInfo = new CreateWindowsInfo2[1];
        createBOMWindowsInfo[0] = new CreateWindowsInfo2();
        topLineObject.addInfo(createBOMWindowsInfo[0]);
        tcRevisionRulesConfiguration.addInfo(createBOMWindowsInfo[0].revRuleConfigInfo);
        createBOMWindowsInfo[0].bomView = bomview;
        return createBOMWindowsInfo;
    }
}
