UrlPatternInput Struct

The (USVString or URLPatternInit) union (https://urlpattern.spec.whatwg.org/#typedefdef-urlpatterninput).

public readonly struct UrlPatternInput : IEquatable<UrlPatternInput>
Implements

Properties

NameDescription
InitGets the components, or null if the value is a string.
StringValueGets the URL or pattern string, or null.
ValueGets the value: a String or a UrlPatternInit (an empty UrlPatternInit for the default value).

Gets the components, or null if the value is a string.

public UrlPatternInit? Init { get; }

Property value

UrlPatternInit?

StringValue

UrlPattern.cs

Gets the URL or pattern string, or null.

public string? StringValue { get; }

Property value

string?

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

public object Value { get; }

Property value

object

Methods

NameDescription
Equals(UrlPatternInput)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 an input from a URL or pattern string.
FromUrlPatternInit(UrlPatternInit)Creates an input from the components of a URL pattern or of a URL.
GetHashCode()Returns the hash code for this instance.
ToString()Returns the fully qualified type name of this instance.

Equals overloads

Equals(UrlPatternInput)

UrlPattern.cs

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

public bool Equals(UrlPatternInput other)
Parameters
other UrlPatternInput
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 an input from a URL or pattern string.

public static UrlPatternInput FromString(string value)

Parameters

value string

Returns

UrlPatternInput

FromUrlPatternInit(UrlPatternInit)

UrlPattern.cs

Creates an input from the components of a URL pattern or of a URL.

public static UrlPatternInput FromUrlPatternInit(UrlPatternInit value)

Parameters

value UrlPatternInit

Returns

UrlPatternInput

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 ==(UrlPatternInput, UrlPatternInput)Returns whether the two inputs hold the same value.
implicit operator UrlPatternInput(UrlPatternInit)Converts the components of a URL pattern to an input.
implicit operator UrlPatternInput(string)Converts a string to an input.
operator !=(UrlPatternInput, UrlPatternInput)Returns whether the two inputs hold different values.

operator ==(UrlPatternInput, UrlPatternInput)

UrlPattern.cs

Returns whether the two inputs hold the same value.

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

Parameters

left UrlPatternInput
right UrlPatternInput

Returns

bool

op_Implicit overloads

implicit operator UrlPatternInput(UrlPatternInit)

UrlPattern.cs

Converts the components of a URL pattern to an input.

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

UrlPatternInput

implicit operator UrlPatternInput(string)

UrlPattern.cs

Converts a string to an input.

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

UrlPatternInput

operator !=(UrlPatternInput, UrlPatternInput)

UrlPattern.cs

Returns whether the two inputs hold different values.

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

Parameters

left UrlPatternInput
right UrlPatternInput

Returns

bool