
urldsl.vocabulary.MaybeFragment.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of url-dsl_2.12 Show documentation
Show all versions of url-dsl_2.12 Show documentation
A tiny library for parsing and creating urls in a type-safe way
The newest version!
package urldsl.vocabulary
/** Wrapper around the raw fragment part of the URL.
*
* None when the URL does not contain any fragment.
*/
final case class MaybeFragment(value: Option[String]) extends AnyVal {
/** Prepend the hashtag symbol if the fragment is present, otherwise returns the empty string. */
def representation: String = value.map("#" ++ _).getOrElse("")
def isEmpty: Boolean = value.isEmpty
def nonEmpty: Boolean = value.nonEmpty
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy