UrlPatternCompatible Struct

The (USVString or URLPatternInit or URLPattern) union (https://urlpattern.spec.whatwg.org/#typedefdef-urlpatterncompatible): a URL pattern given to another API (e.g. the urlPattern condition of a service worker router rule).

public readonly struct UrlPatternCompatible : IEquatable<UrlPatternCompatible>
Implements

Properties

NameDescription
ValueGets the value: a String, a UrlPatternInit or a UrlPattern (an empty UrlPatternInit for the default value).

Gets the value: a String, a UrlPatternInit or a UrlPattern (an empty UrlPatternInit for the default value).

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(UrlPatternCompatible)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
FromString(string)Creates the union from a pattern string.
FromUrlPattern(UrlPattern)Creates the union from a URL pattern.
FromUrlPatternInit(UrlPatternInit)Creates the union from the components of a URL pattern.
GetHashCode()Returns the hash code for this instance.
ToString()Returns the fully qualified type name of this instance.

Equals overloads

Equals(UrlPatternCompatible)

UrlPattern.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(UrlPatternCompatible other)
Parameters
other UrlPatternCompatible
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

UrlPattern.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current instance.
Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.

FromString(string)

UrlPattern.cs

Creates the union from a pattern string.

public static UrlPatternCompatible FromString(string value)

Parameters

value string

Returns

UrlPatternCompatible

FromUrlPattern(UrlPattern)

UrlPattern.cs

Creates the union from a URL pattern.

public static UrlPatternCompatible FromUrlPattern(UrlPattern value)

Parameters

value UrlPattern

Returns

UrlPatternCompatible

FromUrlPatternInit(UrlPatternInit)

UrlPattern.cs

Creates the union from the components of a URL pattern.

public static UrlPatternCompatible FromUrlPatternInit(UrlPatternInit value)

Parameters

value UrlPatternInit

Returns

UrlPatternCompatible

GetHashCode()

UrlPattern.cs

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int A 32-bit signed integer that is the hash code for this instance.

ToString()

UrlPattern.cs

Returns the fully qualified type name of this instance.

public override string? ToString()

Returns

string? The fully qualified type name.

Operators

NameDescription
operator ==(UrlPatternCompatible, UrlPatternCompatible)Returns whether the two unions hold the same value.
implicit operator UrlPatternCompatible(UrlPattern)Converts a URL pattern to the union.
implicit operator UrlPatternCompatible(UrlPatternInit)Converts the components of a URL pattern to the union.
implicit operator UrlPatternCompatible(string)Converts a pattern string to the union.
operator !=(UrlPatternCompatible, UrlPatternCompatible)Returns whether the two unions hold different values.

operator ==(UrlPatternCompatible, UrlPatternCompatible)

UrlPattern.cs

Returns whether the two unions hold the same value.

public static bool operator ==(UrlPatternCompatible left, UrlPatternCompatible right)

op_Implicit overloads

implicit operator UrlPatternCompatible(UrlPattern)

UrlPattern.cs

Converts a URL pattern to the union.

public static implicit operator UrlPatternCompatible(UrlPattern value)
Parameters
value UrlPattern
Returns

UrlPatternCompatible

implicit operator UrlPatternCompatible(UrlPatternInit)

UrlPattern.cs

Converts the components of a URL pattern to the union.

public static implicit operator UrlPatternCompatible(UrlPatternInit value)
Parameters
value UrlPatternInit
Returns

UrlPatternCompatible

implicit operator UrlPatternCompatible(string)

UrlPattern.cs

Converts a pattern string to the union.

public static implicit operator UrlPatternCompatible(string value)
Parameters
value string
Returns

UrlPatternCompatible

operator !=(UrlPatternCompatible, UrlPatternCompatible)

UrlPattern.cs

Returns whether the two unions hold different values.

public static bool operator !=(UrlPatternCompatible left, UrlPatternCompatible right)