HostPattern

class HostPattern(val pattern: String)(source)

Represents a single host pattern for matching hostnames.

Supported patterns:

  • "example.com" — exact match

  • "*.example.com" — matches exactly one subdomain level (e.g., api.example.com but NOT a.b.example.com)

  • "**.example.com" — matches one or more subdomain levels (e.g., api.example.com, a.b.example.com)

  • "**" — matches everything

All matching is case-insensitive.

Constructors

Link copied to clipboard
constructor(pattern: String)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
fun matches(hostname: String): Boolean

Returns true if the given hostname matches this pattern.

Link copied to clipboard
open override fun toString(): String