java.lang.Object
org.qubership.atp.dataset.service.direct.importexport.utils.ImportUtils

public class ImportUtils extends Object
  • Field Details

  • Constructor Details

    • ImportUtils

      public ImportUtils()
  • Method Details

    • getParameterDsRefName

      public static String getParameterDsRefName(String parameterValue)
      Get parameter dataset reference name. Example of input value: DSL 2 -> DS 4
      Parameters:
      parameterValue - input combined reference name
      Returns:
      dataset reference name
    • getAttributeType

      public static String getAttributeType(Map<Integer,String> row)
      Get attribute type from excel row.
      Parameters:
      row - excel row
      Returns:
      parsed type
    • getAttributeName

      public static String getAttributeName(Map<Integer,String> row)
      Get attribute name from excel row.
      Parameters:
      row - excel row
      Returns:
      parsed attribute name
    • getCellValue

      public static String getCellValue(Map<Integer,String> row, int key)
      Determine cell type and return its string representation, getStringCellValue() method call could throw exception if cell has number value or another type.
      Parameters:
      row - excel row
      key - excel cell index
      Returns:
      string value string representation
    • isBlankRow

      public static boolean isBlankRow(Map<Integer,String> row)
    • isArrowDelimiterPresent

      public static boolean isArrowDelimiterPresent(String attributeName)
    • getDslAttributeKey

      public static String getDslAttributeKey(String datasetListName, String attributeName)
    • getDslAttributeKey

      public static String getDslAttributeKey(Attribute attribute)
    • getDsParameterKey

      public static String getDsParameterKey(Parameter parameter)
      Get dataset parameter key as concatenation of DSL, DS and attribute names. Example, "DSL_DS_attribute".
      Parameters:
      parameter - inpute parameter
      Returns:
      key
    • getDsParameterKey

      public static String getDsParameterKey(DatasetParameterValue datasetParameterValue, String attributeName)
      Get dataset parameter key as concatenation of DSL, DS and attribute names. Example, "DSL_DS_attribute.
      Parameters:
      datasetParameterValue - dataset parameter value
      attributeName - attribute name
      Returns:
      key
    • getDsParameterKey

      public static String getDsParameterKey(String datasetListName, String datasetName, String attributeName)
    • getDatasetKey

      public static String getDatasetKey(String datasetListName, String datasetName)
    • getDatasetKey

      public static String getDatasetKey(DataSet dataset)
    • getDatasetKey

      public static String getDatasetKey(DatasetParameterValue datasetParameterValue)
      Get dataset key as concatenation of DSL and DS names. Example, "DSL_DS".
      Parameters:
      datasetParameterValue - dataset parameter value.
      Returns:
      key
    • getDatasetKeyPathName

      public static String getDatasetKeyPathName(DataSet dataset)
      Get dataset key as concatenation of id DSL and DS name. Example, "IdDSL_NameDS".
      Parameters:
      dataset - input dataset
      Returns:
      key
    • getOverlapKey

      public static String getOverlapKey(AttributeKey attributeKey, AttributeImportContext importContext)
      Get overlap key as concatenation of DS name, attribute key and name. Example, "DS 1_a -> b -> c.
      Parameters:
      attributeKey - overlap entity.
      Returns:
      overlap key
    • getOverlapKey

      public static String getOverlapKey(String datasetName, String attributeName)