Class AbstractAttributeConverter

java.lang.Object
org.qubership.atp.dataset.service.direct.importexport.converters.AbstractAttributeConverter
Direct Known Subclasses:
DatasetLinkAttributeImportConverter, EncryptedAttributeImportConverter, ListAttributeImportConverter, TextAttributeImportConverter

public abstract class AbstractAttributeConverter extends Object
  • Constructor Details

    • AbstractAttributeConverter

      public AbstractAttributeConverter()
  • Method Details

    • isAttributeShouldOverlap

      protected boolean isAttributeShouldOverlap(AttributeImportModel importModel, DatasetParameterValue datasetParameterValue, AttributeImportContext importContext, Predicate<Parameter> parameterPredicate)
      Checks if attribute parameter should be overlapped by comparing current and reference parameter values.
      Parameters:
      importModel - import attribute model
      datasetParameterValue - dataset parameter value
      importContext - import context
      parameterPredicate - predicate for different attribute types value comparing
    • getRefAttributeKey

      protected String getRefAttributeKey(AttributeImportModel importModel, DatasetParameterValue childDatasetParameterValue)
      Gets reference attribute key for attribute model.
      Parameters:
      importModel - import attribute model
      childDatasetParameterValue - child dataset parameter value
      Returns:
      attribute key
    • isDslSubAttribute

      protected boolean isDslSubAttribute(DatasetParameterValue datasetParameterValue)
      Detects if current dataset parameter value is DSL sub attribute.
      Parameters:
      datasetParameterValue - dataset parameter value
    • getDatasetReference

      protected UUID getDatasetReference(DatasetParameterValue datasetParameterValue, AttributeImportContext context)
      Detects if current dataset parameter value is DSL sub attribute and return corresponding or reference dataset id.
      Parameters:
      datasetParameterValue - dataset parameter value
      context - import context
      Returns:
      dataset id
    • getAttributeName

      protected String getAttributeName(Map<Integer,String> row)
      Gets attribute name from imported excel file row.
      Parameters:
      row - excel file row
      Returns:
      attribute name
    • getAttributeKey

      protected String getAttributeKey(Map<Integer,String> row)
      Gets attribute key from excel row.
      Parameters:
      row - excel file row
      Returns:
      attribute key
    • getRowAttributeName

      protected String getRowAttributeName(Map<Integer,String> row)
      Get row attribute name.
      Parameters:
      row - excel file row
      Returns:
      attribute name
    • mapTextRowToImportModel

      protected AttributeImportModel mapTextRowToImportModel(Map<Integer,String> row, AttributeImportContext importContext)
      Map text row (Text, Encrypted and List row types) to import model.
      Parameters:
      row - excel file row
      importContext - import context
      Returns:
      import model
    • getParamValueTarget

      protected String getParamValueTarget(boolean attributeShouldOverlap, DatasetParameterValue datasetParameterValue, AttributeImportContext importContext, UUID attributeId, UUID datasetId, AttributeImportModel importModel, ParameterService parameterService)