package com.capgemini.reports.snecmaobjects.part;

import com.capgemini.framework.teamcenter.authent.TcSession;
import com.capgemini.reports.snecmaobjects.visitor.IComponentVisitor;
import com.capgemini.reports.snecmaobjects.visitor.IReceptorVisitor;
import com.teamcenter.soa.client.model.strong.ItemRevision;

import static com.capgemini.framework.teamcenter.object.SnecmaObjectProperties.PV_TYPE_PART_MONTAGE_1;
import static com.capgemini.framework.teamcenter.object.SnecmaObjectProperties.PV_TYPE_PART_MONTAGE_2;
import static com.capgemini.framework.teamcenter.object.types.SnecmaObjectTypes.PART_ASSEMB_REVISION;

/**
 * Class representing a PartAssembRevision.
 */
public class PartAssembRevision extends AbstractPart {
    private static final long serialVersionUID = -296424509222476913L;

    public PartAssembRevision(final TcSession session, final ItemRevision itemRevision) {
        super(session, itemRevision);
    }

    public String getTypePartMontage1() {
        return getMasterFormRev().getPropertyObject(PV_TYPE_PART_MONTAGE_1).getStringValue();
    }

    public String getTypePartMontage2() {
        return getMasterFormRev().getPropertyObject(PV_TYPE_PART_MONTAGE_2).getStringValue();
    }

    @Override
    public <T> T accept(final IReceptorVisitor<T> aReceptorVisitor) {
        return aReceptorVisitor.visitReceptor(this);
    }

    @Override
    public <T> T accept(final IComponentVisitor<T> aComponentVisitor) {
        return aComponentVisitor.visitComponent(this);
    }

    @Override
    public boolean isSuperModel() {
        return false;
    }

    @Override
    public String toString() {
        return PART_ASSEMB_REVISION + " " + this.getItemId();
    }
}
