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

l.rl_2.9.1.0.3.3.source-code.rl.scala Maven / Gradle / Ivy

The newest version!
import scala.io.Codec

package object rl {

  private[rl] class UriStringExtensions(source: String) {
    def isNotBlank = Option(source).foldLeft(false) { (_, v) ⇒ v.trim.nonEmpty }
    def blankOption = if (isNotBlank) Some(source) else None
  }

  private[rl] class RicherUriString(source: String) {
    def urlEncode = if (source != null && source.trim().nonEmpty) UrlCodingUtils.urlEncode(source) else ""
    def urlDecode = if (source != null && source.trim().nonEmpty) UrlCodingUtils.urlDecode(source) else ""
  }

  private[rl] implicit def string2UriStringExtension(source: String) = new UriStringExtensions(source)
  private[rl] implicit val Utf8Codec = Codec.UTF8

  trait Imports {
    implicit def string2RicherUriString(s: String) = new RicherUriString(s)
  }

  object Imports extends Imports
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy