package com.capgemini.reports.definition.r01report.visitors.snecmaobject;

import com.capgemini.framework.common.DoubleFormatter;
import com.capgemini.framework.common.LanguageHelper;
import com.capgemini.framework.teamcenter.object.pom.status.TcReleaseStatus;
import com.capgemini.reports.definition.r01report.visitors.R01VisitorKeys;
import com.capgemini.reports.snecmaobjects.AbstractSnecmaObject;
import com.capgemini.reports.snecmaobjects.admin.RFAdminAGRevision;
import com.capgemini.reports.snecmaobjects.admin.RFAdminAPRevision;
import com.capgemini.reports.snecmaobjects.admin.RFAdminARevision;
import com.capgemini.reports.snecmaobjects.admin.RFAdminRevision;
import com.capgemini.reports.snecmaobjects.descriptif.DescriptifRevision;
import com.capgemini.reports.snecmaobjects.generic.AbstractGenericRevision;
import com.capgemini.reports.snecmaobjects.generic.GenericAssembRevision;
import com.capgemini.reports.snecmaobjects.generic.GenericRevision;
import com.capgemini.reports.snecmaobjects.mockup.MockupRevision;
import com.capgemini.reports.snecmaobjects.part.*;
import com.capgemini.reports.snecmaobjects.product.ProductRevision;
import com.capgemini.reports.snecmaobjects.rf.AbstractRF;
import com.capgemini.reports.snecmaobjects.rf.RFGenericRevision;
import com.capgemini.reports.snecmaobjects.rf.RFPartAssembRevision;
import com.capgemini.reports.snecmaobjects.rf.RFPartRevision;
import com.capgemini.reports.snecmaobjects.supermodel.AbstractSuperModelRevision;
import com.capgemini.reports.snecmaobjects.supermodel.SuperModelRevision;
import com.capgemini.reports.snecmaobjects.visitor.IComponentVisitor;

import java.util.EnumMap;
import java.util.List;
import java.util.Map;

/**
 * Visit a Component SnecmaObject to make a R01 report.
 */
public class R01ComponentVisitor implements IComponentVisitor<Map<R01VisitorKeys, String>> {
  private static final long serialVersionUID = -2446473004152109053L;

  private static final int MASS_SIGNIFICANT_DIGITS = 15;
  private static final String EMPTY_STRING = "";
  private static final String PART_MAT = "PartMat";
  private static final String SEPARATOR = " / ";
  private static final String VALUE_MATIERE = "matière";
  private static final String PRODUIT = "Produit";
  private static final String GENERIQUE_MONTAGE = "Générique Montage";
  private static final String GENERIQUE = "Générique";
  private static final String PARAM_NON = "Non";
  private static final String PARAM_OUI = "Oui";
  private static final String SOLO_SEPARATOR = "/";

  private static String french(final String string) {
    return LanguageHelper.french(string);
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final ProductRevision aProductRev) {
    Map<R01VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aProductRev);
    theMap.put(R01VisitorKeys.DESIGNATION_EN, aProductRev.getDesignationEN());
    theMap.put(R01VisitorKeys.TYPE_PRODUIT, aProductRev.getTypeProduit());
    theMap.put(R01VisitorKeys.TYPE_REFERENCE, PRODUIT);
    theMap.put(R01VisitorKeys.SUIVI_UTILISATION, PARAM_NON);
    theMap.put(R01VisitorKeys.SUIVI_DUREE_VIE, PARAM_NON);
    theMap.put(R01VisitorKeys.REFERENCE_CONCEPTEUR, EMPTY_STRING);
    theMap.put(R01VisitorKeys.REFERENCE_TRANSPOSEE, EMPTY_STRING);
    theMap.put(R01VisitorKeys.RESPONSABLE_CONCEPTION, EMPTY_STRING);
    theMap.put(R01VisitorKeys.MASSE_INDICATIVE, EMPTY_STRING);
    theMap.put(R01VisitorKeys.UNITE_DE_MASSE, EMPTY_STRING);
    theMap.put(R01VisitorKeys.STATUT_REFERENCE_ARTICLE, statutReferenceArticle(aProductRev.getStatusList()));
    theMap.put(R01VisitorKeys.CLASSEMENT, "-");
    theMap.put(R01VisitorKeys.ALTERNATIVE, EMPTY_STRING);
    theMap.put(R01VisitorKeys.SUIVI_DEVELOPPEMENT, EMPTY_STRING);
    theMap.put(R01VisitorKeys.DOCUMENT_CONTROLE, EMPTY_STRING);
    theMap.put(R01VisitorKeys.OBTURATION, EMPTY_STRING);
    theMap.put(R01VisitorKeys.DATE_PEREMPTION, EMPTY_STRING);
    theMap.put(R01VisitorKeys.MOT_CLE_EN, EMPTY_STRING);
    theMap.put(R01VisitorKeys.MOT_CLE_FR, EMPTY_STRING);
    theMap.put(R01VisitorKeys.CR, EMPTY_STRING);
    theMap.put(R01VisitorKeys.CN, EMPTY_STRING);
    return theMap;
  }

  private String statutReferenceArticle(final List<TcReleaseStatus> statuses) {
    StringBuilder builder = new StringBuilder();
    int size = statuses.size();
    for (int i = 0; i < size; i++) {
      builder.append(statuses.get(i).getDisplayableName());
      if (i != size - 1) {
        builder.append(", ");
      }
    }
    return builder.toString();
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final GenericRevision aGenericRev) {
    Map<R01VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aGenericRev);
    theMap.put(R01VisitorKeys.TYPE_REFERENCE, GENERIQUE);
    putGenericProperties(theMap, aGenericRev);
    return theMap;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final GenericAssembRevision aGenericAssembRev) {
    Map<R01VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aGenericAssembRev);
    theMap.put(R01VisitorKeys.TYPE_REFERENCE, GENERIQUE_MONTAGE);
    putGenericProperties(theMap, aGenericAssembRev);
    return theMap;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final SuperModelRevision aSuperModelRev) {
    Map<R01VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aSuperModelRev);
    theMap.put(R01VisitorKeys.TYPE_REFERENCE, GENERIQUE);
    putSuperModelProperties(theMap, aSuperModelRev);
    return theMap;
  }


  @Override
  public Map<R01VisitorKeys, String> visitComponent(final AlternateRevision anAlternateRev) {
    Map<R01VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(anAlternateRev);
    putPartProperties(theMap, anAlternateRev);
    theMap.put(R01VisitorKeys.TYPE_REFERENCE, french(anAlternateRev.getTypeAlt1()) + SEPARATOR + french(anAlternateRev.getTypeAlt2()));
    theMap.put(R01VisitorKeys.SUIVI_DEVELOPPEMENT, french(anAlternateRev.getSuiviDeveloppement()));
    theMap.put(R01VisitorKeys.DOCUMENT_CONTROLE, french(anAlternateRev.getDocumentControle()));
    theMap.put(R01VisitorKeys.OBTURATION, french(anAlternateRev.getObturation()));
    theMap.put(R01VisitorKeys.DATE_PEREMPTION, EMPTY_STRING);
    return theMap;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final DETRevision aDetRev) {
    Map<R01VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aDetRev);
    putPartProperties(theMap, aDetRev);
    theMap.put(R01VisitorKeys.TYPE_REFERENCE, french(aDetRev.getTypeDet1()) + SEPARATOR + french(aDetRev.getTypeDet2()));
    theMap.put(R01VisitorKeys.SUIVI_DEVELOPPEMENT, french(aDetRev.getSuiviDeveloppement()));
    theMap.put(R01VisitorKeys.DOCUMENT_CONTROLE, french(aDetRev.getDocumentControle()));
    theMap.put(R01VisitorKeys.OBTURATION, french(aDetRev.getObturation()));
    return theMap;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final PartAeroRevision aPartAeroRev) {
    Map<R01VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aPartAeroRev);
    putPartProperties(theMap, aPartAeroRev);
    theMap.put(R01VisitorKeys.TYPE_REFERENCE, french(aPartAeroRev.getTypeAero1()) + SEPARATOR + french(aPartAeroRev.getTypeAero2()) + SEPARATOR + french(aPartAeroRev.getTypeAero3()));
    theMap.put(R01VisitorKeys.SUIVI_DEVELOPPEMENT, french(aPartAeroRev.getSuiviDeveloppement()));
    theMap.put(R01VisitorKeys.DOCUMENT_CONTROLE, french(aPartAeroRev.getDocumentControle()));
    theMap.put(R01VisitorKeys.OBTURATION, french(aPartAeroRev.getObturation()));
    return theMap;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final PartNoAeroRevision aPartNoAeroRev) {
    Map<R01VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aPartNoAeroRev);
    putPartProperties(theMap, aPartNoAeroRev);
    theMap.put(R01VisitorKeys.TYPE_REFERENCE, french(aPartNoAeroRev.getTypeNoAero()));
    theMap.put(R01VisitorKeys.SUIVI_DEVELOPPEMENT, french(aPartNoAeroRev.getSuiviDeveloppement()));
    theMap.put(R01VisitorKeys.DOCUMENT_CONTROLE, french(aPartNoAeroRev.getDocumentControle()));
    theMap.put(R01VisitorKeys.OBTURATION, EMPTY_STRING);
    theMap.put(R01VisitorKeys.DATE_PEREMPTION, EMPTY_STRING);
    return theMap;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final PartAssembRevision aPartAssembRev) {
    Map<R01VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aPartAssembRev);
    putPartProperties(theMap, aPartAssembRev);
    theMap.put(R01VisitorKeys.TYPE_REFERENCE, french(aPartAssembRev.getTypePartMontage1()) + SEPARATOR + french(aPartAssembRev.getTypePartMontage2()));
    theMap.put(R01VisitorKeys.SUIVI_DEVELOPPEMENT, EMPTY_STRING);
    theMap.put(R01VisitorKeys.DOCUMENT_CONTROLE, french(aPartAssembRev.getDocumentControle()));
    theMap.put(R01VisitorKeys.OBTURATION, EMPTY_STRING);
    theMap.put(R01VisitorKeys.DATE_PEREMPTION, EMPTY_STRING);
    return theMap;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final PartMatRevision aPartMatRev) {
    Map<R01VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aPartMatRev);
    putPartProperties(theMap, aPartMatRev);
    theMap.put(R01VisitorKeys.TYPE_REFERENCE, VALUE_MATIERE);
    theMap.put(R01VisitorKeys.CLASSEMENT, aPartMatRev.getClassementMat());
    theMap.put(R01VisitorKeys.MASSE_INDICATIVE, EMPTY_STRING);
    theMap.put(R01VisitorKeys.UNITE_DE_MASSE, EMPTY_STRING);
    theMap.put(R01VisitorKeys.SUIVI_UTILISATION, PARAM_NON);
    theMap.put(R01VisitorKeys.SUIVI_DUREE_VIE, PARAM_NON);
    theMap.put(R01VisitorKeys.SUIVI_DEVELOPPEMENT, EMPTY_STRING);
    theMap.put(R01VisitorKeys.DOCUMENT_CONTROLE, EMPTY_STRING);
    theMap.put(R01VisitorKeys.OBTURATION, EMPTY_STRING);
    theMap.put(R01VisitorKeys.DATE_PEREMPTION, EMPTY_STRING);
    theMap.put(R01VisitorKeys.MOT_CLE_EN, EMPTY_STRING);
    theMap.put(R01VisitorKeys.MOT_CLE_FR, EMPTY_STRING);
    return theMap;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final StandardRevision aStandardRev) {
    Map<R01VisitorKeys, String> theMap = getAbstractSnecmaObjectProperties(aStandardRev);
    putPartProperties(theMap, aStandardRev);
    theMap.put(R01VisitorKeys.TYPE_REFERENCE, french(aStandardRev.getTypeStandard()));
    theMap.put(R01VisitorKeys.SUIVI_DEVELOPPEMENT, french(aStandardRev.getSuiviDeveloppement()));
    theMap.put(R01VisitorKeys.DOCUMENT_CONTROLE, french(aStandardRev.getDocumentControle()));
    theMap.put(R01VisitorKeys.OBTURATION, EMPTY_STRING);
    return theMap;
  }

  /**
   * Get Component properties to make a R01 report.
   *
   * @param anAbstractSnecmaObject AbstractSnecmaObject
   * @return theMap Map<R23VisitorKeys,String>
   */
  private Map<R01VisitorKeys, String> getAbstractSnecmaObjectProperties(final AbstractSnecmaObject anAbstractSnecmaObject) {
    Map<R01VisitorKeys, String> theMap = new EnumMap<>(R01VisitorKeys.class);
    theMap.put(R01VisitorKeys.REF_FABRICANT_REF_SNECMA, anAbstractSnecmaObject.getItemId());
    theMap.put(R01VisitorKeys.NOM_REFERENCE, anAbstractSnecmaObject.getName());
    theMap.put(R01VisitorKeys.REVISION_REFERENCE, anAbstractSnecmaObject.getRevisionId());
    theMap.put(R01VisitorKeys.ALTERNATIVE, EMPTY_STRING);
    return theMap;
  }

  /**
   * Put the Generic properties into aMap.
   *
   * @param aMap                      Map<R23VisitorKeys, String>
   * @param anAbstractGenericRevision AbstractGenericRevision
   */
  private void putGenericProperties(final Map<R01VisitorKeys, String> aMap, final AbstractGenericRevision anAbstractGenericRevision) {
    aMap.put(R01VisitorKeys.DESIGNATION_EN, anAbstractGenericRevision.getDesignationEN());
    aMap.put(R01VisitorKeys.RESPONSABLE_CONCEPTION, anAbstractGenericRevision.getResponsableConception());
    aMap.put(R01VisitorKeys.SUIVI_UTILISATION, PARAM_OUI);
    aMap.put(R01VisitorKeys.SUIVI_DUREE_VIE, PARAM_NON);
    aMap.put(R01VisitorKeys.REFERENCE_CONCEPTEUR, EMPTY_STRING);
    aMap.put(R01VisitorKeys.REFERENCE_TRANSPOSEE, EMPTY_STRING);
    aMap.put(R01VisitorKeys.MASSE_INDICATIVE, EMPTY_STRING);
    aMap.put(R01VisitorKeys.UNITE_DE_MASSE, EMPTY_STRING);
    aMap.put(R01VisitorKeys.STATUT_REFERENCE_ARTICLE, statutReferenceArticle(anAbstractGenericRevision.getStatusList()));
    aMap.put(R01VisitorKeys.ALTERNATIVE, EMPTY_STRING);
    aMap.put(R01VisitorKeys.CLASSEMENT, "-");
    aMap.put(R01VisitorKeys.TYPE_PRODUIT, EMPTY_STRING);
    aMap.put(R01VisitorKeys.SUIVI_DEVELOPPEMENT, EMPTY_STRING);
    aMap.put(R01VisitorKeys.DOCUMENT_CONTROLE, EMPTY_STRING);
    aMap.put(R01VisitorKeys.OBTURATION, EMPTY_STRING);
    aMap.put(R01VisitorKeys.DATE_PEREMPTION, EMPTY_STRING);
    aMap.put(R01VisitorKeys.MOT_CLE_EN, EMPTY_STRING);
    aMap.put(R01VisitorKeys.MOT_CLE_FR, EMPTY_STRING);
    aMap.put(R01VisitorKeys.CR, EMPTY_STRING);
    aMap.put(R01VisitorKeys.CN, EMPTY_STRING);
  }


  /**
   * Put the Super Model properties into aMap.
   *
   * @param aMap                      Map<R23VisitorKeys, String>
   * @param anAbstractSuperModelRevision AbstractSuperModelRevision
   */
  private void putSuperModelProperties(final Map<R01VisitorKeys, String> aMap, final AbstractSuperModelRevision anAbstractSuperModelRevision) {
    aMap.put(R01VisitorKeys.SUIVI_UTILISATION, EMPTY_STRING);
    aMap.put(R01VisitorKeys.SUIVI_DUREE_VIE, EMPTY_STRING);
    aMap.put(R01VisitorKeys.REFERENCE_CONCEPTEUR, EMPTY_STRING);
    aMap.put(R01VisitorKeys.REFERENCE_TRANSPOSEE, EMPTY_STRING);
    aMap.put(R01VisitorKeys.MASSE_INDICATIVE, EMPTY_STRING);
    aMap.put(R01VisitorKeys.UNITE_DE_MASSE, EMPTY_STRING);
    aMap.put(R01VisitorKeys.TYPE_REFERENCE, french(anAbstractSuperModelRevision.getType()));
    aMap.put(R01VisitorKeys.STATUT_REFERENCE_ARTICLE, statutReferenceArticle(anAbstractSuperModelRevision.getStatusList()));
    aMap.put(R01VisitorKeys.ALTERNATIVE, EMPTY_STRING);
    aMap.put(R01VisitorKeys.CLASSEMENT, "-");
    aMap.put(R01VisitorKeys.TYPE_PRODUIT, EMPTY_STRING);
    aMap.put(R01VisitorKeys.SUIVI_DEVELOPPEMENT, EMPTY_STRING);
    aMap.put(R01VisitorKeys.DOCUMENT_CONTROLE, EMPTY_STRING);
    aMap.put(R01VisitorKeys.OBTURATION, EMPTY_STRING);
    aMap.put(R01VisitorKeys.DESIGNATION_EN, EMPTY_STRING);
    aMap.put(R01VisitorKeys.RESPONSABLE_CONCEPTION, EMPTY_STRING);
    aMap.put(R01VisitorKeys.DATE_PEREMPTION, EMPTY_STRING);
    aMap.put(R01VisitorKeys.MOT_CLE_EN, EMPTY_STRING);
    aMap.put(R01VisitorKeys.MOT_CLE_FR, EMPTY_STRING);
    aMap.put(R01VisitorKeys.CR, EMPTY_STRING);
    aMap.put(R01VisitorKeys.CN, EMPTY_STRING);

  }


  /**
   * Put the Part properties into aMap.
   *
   * @param aMap           Map<R23VisitorKeys, String>
   * @param anAbstractPart AbstractPart
   */
  private void putPartProperties(final Map<R01VisitorKeys, String> aMap, final AbstractPart anAbstractPart) {
    aMap.put(R01VisitorKeys.DESIGNATION_EN, anAbstractPart.getDesignationEN());
    aMap.put(R01VisitorKeys.REFERENCE_CONCEPTEUR, anAbstractPart.getRefCompleteConcepteur());
    aMap.put(R01VisitorKeys.REFERENCE_TRANSPOSEE, anAbstractPart.getRefTransposeeSnecma());
    aMap.put(R01VisitorKeys.RESPONSABLE_CONCEPTION, anAbstractPart.getResponsableConception());
    if (!PART_MAT.equals(anAbstractPart.getType())) {
      aMap.put(R01VisitorKeys.CLASSEMENT, anAbstractPart.getClassement());
      aMap.put(R01VisitorKeys.SUIVI_UTILISATION, french(anAbstractPart.getSuiviUtilisation()));
      aMap.put(R01VisitorKeys.SUIVI_DUREE_VIE, french(anAbstractPart.getSuiviDureeVie()));
      aMap.put(R01VisitorKeys.MASSE_INDICATIVE, DoubleFormatter.toSignificantDigits(anAbstractPart.getMass(), MASS_SIGNIFICANT_DIGITS));
      aMap.put(R01VisitorKeys.UNITE_DE_MASSE, anAbstractPart.getMassUnit());
    }
    aMap.put(R01VisitorKeys.STATUT_REFERENCE_ARTICLE, statutReferenceArticle(anAbstractPart.getStatusList()));
    aMap.put(R01VisitorKeys.TYPE_PRODUIT, anAbstractPart.getTypeProduit());
    aMap.put(R01VisitorKeys.DATE_PEREMPTION, anAbstractPart.getExpirationDate());
    aMap.put(R01VisitorKeys.MOT_CLE_EN, anAbstractPart.getMotClefEN());
    aMap.put(R01VisitorKeys.MOT_CLE_FR, anAbstractPart.getMotClefFR());
    aMap.put(R01VisitorKeys.CR, anAbstractPart.getCRPseudoFolderContentAsString());
    aMap.put(R01VisitorKeys.CN, anAbstractPart.getCNPseudoFolderContentAsString());
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final RFGenericRevision aRfGenericRev) {
    Map<R01VisitorKeys, String> theMap = getRfProperties(aRfGenericRev);
    theMap.put(R01VisitorKeys.SUIVI_MONTAGE, PARAM_NON);
    return theMap;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final RFPartAssembRevision aRfPartAssembRev) {
    Map<R01VisitorKeys, String> theMap = new EnumMap<>(R01VisitorKeys.class);
    theMap.put(R01VisitorKeys.REPERE_FONCTIONNEL, aRfPartAssembRev.getName());
    theMap.put(R01VisitorKeys.REVISION_REPERE_FONCTIONNEL, aRfPartAssembRev.getRevisionId());
    theMap.put(R01VisitorKeys.IDENTIFIANT_REPERE_FONCTIONNEL, aRfPartAssembRev.getItemId());
    theMap.put(R01VisitorKeys.EQUIVALENT_SNSSIN, EMPTY_STRING);
    return theMap;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final RFPartRevision aRfPartRev) {
    return getRfProperties(aRfPartRev);
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final RFAdminRevision aRfAdminRev) {
    Map<R01VisitorKeys, String> theMap = new EnumMap<>(R01VisitorKeys.class);
    theMap.put(R01VisitorKeys.RESPONSABLE_REPERE, aRfAdminRev.getResponsableRepere());
    theMap.put(R01VisitorKeys.MAQUETTE, french(aRfAdminRev.getMaqIntExt()));
    return theMap;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final RFAdminARevision aRfAdminARev) {
    Map<R01VisitorKeys, String> theMap = new EnumMap<>(R01VisitorKeys.class);
    theMap.put(R01VisitorKeys.SUIVI_MONTAGE, french(aRfAdminARev.getSuiviMontage()));
    theMap.put(R01VisitorKeys.RESPONSABLE_REPERE, aRfAdminARev.getResponsableRepere());
    theMap.put(R01VisitorKeys.MAQUETTE, french(aRfAdminARev.getMaqIntExt()));
    theMap.put(R01VisitorKeys.TRANSFERT_LIEN_LOGISTIQUE, french(aRfAdminARev.getTransfertLienLogisti()));
    theMap.put(R01VisitorKeys.TRANSFERT_LIEN_MONTAGE, french(aRfAdminARev.getTransfertLienMontage()));
    return theMap;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final RFAdminAPRevision aRfAdminAPRev) {
    Map<R01VisitorKeys, String> theMap = new EnumMap<>(R01VisitorKeys.class);
    theMap.put(R01VisitorKeys.SUIVI_MONTAGE, french(aRfAdminAPRev.getSuiviMontage()));
    theMap.put(R01VisitorKeys.TRANSFERT_LIEN_LOGISTIQUE, french(aRfAdminAPRev.getTransfertLienLogisti()));
    theMap.put(R01VisitorKeys.TRANSFERT_LIEN_MONTAGE, french(aRfAdminAPRev.getTransfertLienMontage()));
    return theMap;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final RFAdminAGRevision aRfAdminAGRev) {
    Map<R01VisitorKeys, String> theMap = new EnumMap<>(R01VisitorKeys.class);
    theMap.put(R01VisitorKeys.TRANSFERT_LIEN_LOGISTIQUE, french(aRfAdminAGRev.getTransfertLienLogisti()));
    theMap.put(R01VisitorKeys.TRANSFERT_LIEN_MONTAGE, french(aRfAdminAGRev.getTransfertLienMontage()));
    return theMap;
  }

  /**
   * Get the Repere Component properties to make a R01 report.
   *
   * @param anAbstractRF AbstractRF
   * @return theMap Map<R23VisitorKeys,String>
   */
  private Map<R01VisitorKeys, String> getRfProperties(final AbstractRF anAbstractRF) {
    Map<R01VisitorKeys, String> theMap = new EnumMap<>(R01VisitorKeys.class);
    theMap.put(R01VisitorKeys.REPERE_FONCTIONNEL, anAbstractRF.getName());
    theMap.put(R01VisitorKeys.IDENTIFIANT_REPERE_FONCTIONNEL, anAbstractRF.getItemId());
    theMap.put(R01VisitorKeys.REVISION_REPERE_FONCTIONNEL, anAbstractRF.getRevisionId());
    theMap.put(R01VisitorKeys.EQUIVALENT_SNSSIN, anAbstractRF.getEquivalentSnsSin());
    return theMap;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final MockupRevision aMockupRev) {
    // This object is not use in this report
    return null;
  }

  @Override
  public Map<R01VisitorKeys, String> visitComponent(final DescriptifRevision aDescriptifRev) {
    // This object is not use in this report
    return null;
  }
}
