UriFilter

class UriFilter

Filter helper for filtering uris with (or without) particular requirements, conditions or patterns.

Usage example:

Uri.parse("your uri string").filter { absolute() hierarchical() withScheme("mailto", "tel") with { it.query != null } without { it.port == 123 } ... }.getOrNull()

or :

Uri.parse("your uri string").with { it.authority?.isDigitsOnly() ?: false }

Uri.parse("your uri string").without { it.authority.isNullOrEmpty() }

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
fun absolute()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun notOpaque()
Link copied to clipboard
fun notStartWith(prefix: String)
Link copied to clipboard
fun opaque()
Link copied to clipboard
fun relative()
Link copied to clipboard
fun startWith(prefix: String)
Link copied to clipboard
fun with(condition: (Uri) -> Boolean)
Link copied to clipboard
fun without(condition: (Uri) -> Boolean)
Link copied to clipboard
fun withoutPattern(pattern: Pattern)
Link copied to clipboard
fun withoutScheme(vararg schemes: String)
Link copied to clipboard
fun withPattern(pattern: Pattern)
Link copied to clipboard
fun withScheme(vararg schemes: String)