spice.http.BooleanHeaderKey.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spice-core_sjs1_3 Show documentation
Show all versions of spice-core_sjs1_3 Show documentation
Core functionality leveraged and shared by most other sub-projects of Spice.
package spice.http
class BooleanHeaderKey(val key: String, val commaSeparated: Boolean = true) extends TypedHeaderKey[Boolean] {
override def value(headers: Headers): Option[Boolean] = get(headers).map(_.toBoolean)
override def apply(value: Boolean): Header = Header(this, value.toString)
}