package com.capgemini.reports.documentationobjects;

import com.capgemini.framework.teamcenter.authent.TcSession;
import com.teamcenter.soa.client.model.strong.ItemRevision;
import lombok.extern.slf4j.Slf4j;

import static com.capgemini.framework.teamcenter.object.SnecmaObjectProperties.PV_DESIGNATION_EN;
import static com.capgemini.framework.teamcenter.object.SnecmaObjectProperties.PV_INDICE_CARTOUCHE;

/**
 * Class representing a DocGeometry.
 */
@Slf4j
public class DocGeometry extends AbstractDoc {
    private static final long serialVersionUID = -7626101075442466263L;

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

    public String getName() {
        return itemRevision.get_object_name();
    }

    public String getDesignationEN() {
        return getMasterFormRev().getPropertyObject(PV_DESIGNATION_EN).getStringValue();
    }

    public String getIndiceCartouche() {
        return getMasterFormRev().getPropertyObject(PV_INDICE_CARTOUCHE).getStringValue();
    }

    @Override
    public <T> T accept(final IDocVisitor<T> docVisitor) {
        return docVisitor.visit(this);
    }
}
