match

fun match(pattern: ContentType): Boolean

Checks if this type matches a pattern type taking into account placeholder symbols * and parameters. The this type must be a more specific type than the pattern type. In other words:

ContentType("a", "b").match(ContentType("a", "b").withParameter("foo", "bar")) === false
ContentType("a", "b").withParameter("foo", "bar").match(ContentType("a", "b")) === true
ContentType("a", "*").match(ContentType("a", "b")) === false
ContentType("a", "b").match(ContentType("a", "*")) === true

Report a problem


fun match(pattern: String): Boolean

Checks if this type matches a pattern type taking into account placeholder symbols * and parameters.

Report a problem