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.*;
import static com.capgemini.framework.teamcenter.object.types.SnecmaObjectTypes.DET_REVISION;

public class DETRevision extends AbstractAltOrDetRevision {
    private static final long serialVersionUID = -7225493417867464752L;

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

    public String getTypeDet1() {
        return getMasterFormRev().getPropertyObject(PV_TYPE_DET_1).getStringValue();
    }


    public String getTypeDet2() {
        return getMasterFormRev().getPropertyObject(PV_TYPE_DET_2).getStringValue();
    }

    public String getObturation() {
        return getMasterFormRev().getPropertyObject(PV_OBTURATION).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 DET_REVISION + " " + this.getItemId();
    }
}
