Skip to content

Commit

Permalink
Produce string of boolean is true, useful to generate SQL
Browse files Browse the repository at this point in the history
  • Loading branch information
avernet committed Jun 1, 2016
1 parent 261d6fb commit aaf463c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions common/src/main/scala/org/orbeon/oxf/util/ScalaUtils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ object ScalaUtils extends PathOps {
// Extensions on Boolean
implicit class BooleanWrapper(val b: Boolean) extends AnyVal {
def option[A](a: A) = if (b) Option(a) else None
def string(s: String) = if (b) s else ""
def list[A](a: A) = if (b) List(a) else Nil
def set[A](a: A) = if (b) Set(a) else Set.empty[A]
def iterator[A](a: A) = if (b) Iterator(a) else Iterator.empty
Expand Down

0 comments on commit aaf463c

Please sign in to comment.