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

org.virtuslab.beholder.utils.SeqParametersHelper.scala Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package org.virtuslab.beholder.utils

import org.virtuslab.unicorn.LongUnicornPlay.driver.simple._

object SeqParametersHelper {

  def isColumnValueInsideSeq[A](column: Column[A])(dataSeq: Seq[A])(isEqual: (Column[A], A) => Column[Option[Boolean]]): Column[Option[Boolean]] = {
    if (dataSeq.isEmpty) {
      LiteralColumn(Option(true))
    } else {
      dataSeq.foldLeft(Option(false): Column[Option[Boolean]])((acc, data) => acc || isEqual(column, data))
    }
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy