All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.innovenso.townplanner.io.concepts.SWOTPropertyExcelIO.scala Maven / Gradle / Ivy

package com.innovenso.townplanner.io.concepts

import com.innovenso.townplanner.io.concepts.ExcelFields.{
  DESCRIPTION,
  NAME,
  TYPE
}
import com.innovenso.townplanner.model.EnterpriseArchitecture
import com.innovenso.townplanner.model.concepts.properties.{
  ExternalId,
  HasExternalIds,
  HasSWOT,
  SWOT
}

object SWOTPropertyExcelIO extends PropertiesExcelIO[HasSWOT, SWOT] {
  override def sheetName: String = "SWOT"

  override def headerLabels: List[String] = List(NAME, DESCRIPTION)

  override def cellValues(property: SWOT): List[String] =
    List(property.name, property.description)

  override def properties(holder: HasSWOT): List[SWOT] =
    holder.swots

  override def propertyClass: Class[SWOT] = classOf[SWOT]

  override def propertyHolderClass: Class[HasSWOT] = classOf[HasSWOT]

  override def readProperty(
      props: PropertyProperties,
      enterpriseArchitecture: EnterpriseArchitecture
  ): Unit = {
    val modelComponent = enterpriseArchitecture.hasProperty(
      props.conceptKey,
      SWOT.fromString(props(NAME), props(DESCRIPTION))
    )
    println(s"added SWOT to $modelComponent")
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy