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

com.norbitltd.spoiwo.model.TableStyle.scala Maven / Gradle / Ivy

There is a newer version: 1.8.0
Show newest version
package com.norbitltd.spoiwo.model

object TableStyle {

  def apply(
      name: TableStyleName,
      showColumnStripes: java.lang.Boolean = null,
      showRowStripes: java.lang.Boolean = null
  ): TableStyle =
    TableStyle(
      name = name,
      showColumnStripes = Option(showColumnStripes).map(_.booleanValue),
      showRowStripes = Option(showRowStripes).map(_.booleanValue)
    )
}

case class TableStyle private (
    name: TableStyleName,
    showColumnStripes: Option[Boolean],
    showRowStripes: Option[Boolean]
) {

  def withName(name: TableStyleName): TableStyle =
    copy(name = name)

  def withColumnStripes: TableStyle =
    copy(showColumnStripes = Some(true))

  def withoutColumnStripes: TableStyle =
    copy(showColumnStripes = Some(false))

  def withRowStripes: TableStyle =
    copy(showRowStripes = Some(true))

  def withoutRowStripes: TableStyle =
    copy(showRowStripes = Some(false))
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy