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

com.natpryce.krouton.composition_operators.kt Maven / Gradle / Ivy

package com.natpryce.krouton

operator fun String.unaryPlus() = root + this
operator fun  PathTemplate.unaryPlus() = root + this

operator fun  PathTemplate.plus(fixedElement: String): PathTemplate =
    this + LiteralPathElement(fixedElement)

@JvmName("append")
operator fun  PathTemplate.plus(rest: PathTemplate): PathTemplate> = AppendedPathTemplate(this, rest)

@JvmName("plusPrefix")
operator fun  PathTemplate.plus(rest: PathTemplate): PathTemplate =
    PrefixedPathTemplate(this, rest)

@JvmName("plusSuffix")
operator fun  PathTemplate.plus(suffix: PathTemplate): PathTemplate =
    SuffixedPathTemplate(this, suffix)

operator fun  PathTemplate.plus(rest: PathTemplate): PathTemplate> =
    AppendedPathTemplate(this asA tStack(), rest)

infix fun  PathTemplate.where(p: (T) -> Boolean): PathTemplate = RestrictedPathTemplate(this, p)

infix fun  PathTemplate.asA(projection: Projection): PathTemplate =
    ProjectedPathTemplate(this, projection)