package com.capgemini.reports.snecmaobjects.admin;

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_TRANSFERT_LIEN_LOGISTI;
import static com.capgemini.framework.teamcenter.object.SnecmaObjectProperties.PV_TRANSFERT_LIEN_MONTAGE;
import static com.capgemini.framework.teamcenter.object.types.SnecmaObjectTypes.RF_ADMIN_AG_REVISION;

/**
 * Class representing a RFAdminAGRevision.
 */
public class RFAdminAGRevision extends AbstractAdmin {
    private static final long serialVersionUID = -5970076629996941060L;

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

    public String getTransfertLienLogisti() {
        return getMasterFormRev().getPropertyObject(PV_TRANSFERT_LIEN_LOGISTI).getStringValue();
    }

    public String getTransfertLienMontage() {
        return getMasterFormRev().getPropertyObject(PV_TRANSFERT_LIEN_MONTAGE).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 RF_ADMIN_AG_REVISION + " " + this.getItemId();
    }
}
