com.hexagonkt.http.patterns.PathPattern.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http Show documentation
Show all versions of http Show documentation
HTTP classes. These classes are shared among the HTTP client and the HTTP server.
The newest version!
package com.hexagonkt.http.patterns
interface PathPattern {
val pattern: String
val prefix: Boolean
fun addPrefix(prefix: String?): PathPattern
fun matches(requestUrl: String): Boolean
fun extractParameters(requestUrl: String): Map
fun insertParameters(parameters: Map): String =
error("${type()} path pattern does not accept parameters")
fun describe(): String =
"${type()}${if (prefix) " (PREFIX)" else ""} '$pattern'"
private fun type(): String =
javaClass.simpleName.removeSuffix(typeSuffix)
private companion object {
val typeSuffix: String = PathPattern::class.java.simpleName
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy