Table of Contents

Class Patch<T>

Namespace
VpnHood.Net.Toolkit.Utils
Assembly
VpnHood.Net.Toolkit.dll

Represents a value set in a patch, so a patch can tell a property set to null from one left out, which a null Patch<T> stands for.

public class Patch<T>

Type Parameters

T

The type of the value.

Inheritance
Patch<T>
Inherited Members

Constructors

Patch(T)

Represents a value set in a patch, so a patch can tell a property set to null from one left out, which a null Patch<T> stands for.

public Patch(T value)

Parameters

value T

The value.

Properties

Value

Gets the value.

public T Value { get; }

Property Value

T

Methods

Equals(object?)

Determines whether the patch equals an object: another patch by its value, anything else with the value itself.

public override bool Equals(object? obj)

Parameters

obj object

The object.

Returns

bool

true if they are equal; otherwise, false.

GetHashCode()

Returns the value's hash code, or an empty string's for null.

public override int GetHashCode()

Returns

int

The hash code.

ToString()

Returns the value's text, or empty for null.

public override string ToString()

Returns

string

The text.

Operators

implicit operator T(Patch<T>)

Unwraps a patch's value.

public static implicit operator T(Patch<T> value)

Parameters

value Patch<T>

The patch.

Returns

T

The value.

Exceptions

NullReferenceException

The patch is null: the value was not set.

implicit operator Patch<T>(T)

Wraps a value in a patch.

public static implicit operator Patch<T>(T value)

Parameters

value T

The value.

Returns

Patch<T>

The patch.