Table of Contents

Class KeyValuePairCollectionRemoteValue

Namespace
WebDriverBiDi.Script
Assembly
WebDriverBiDi.dll

Represents a remote value for a key-value pair object from the remote end, providing type-safe access to the dictionary containing the values and the ability to convert to a local value for use as an argument for script execution on the remote end.

public record KeyValuePairCollectionRemoteValue : RemoteValue, IEquatable<RemoteValue>, IObjectReferenceRemoteValue, ITypeSafeRemoteValue<RemoteValueDictionary?>, IEquatable<KeyValuePairCollectionRemoteValue>
Inheritance
KeyValuePairCollectionRemoteValue
Implements
Inherited Members

Constructors

KeyValuePairCollectionRemoteValue(KeyValuePairCollectionRemoteValue)

protected KeyValuePairCollectionRemoteValue(KeyValuePairCollectionRemoteValue original)

Parameters

original KeyValuePairCollectionRemoteValue

Properties

EqualityContract

protected override Type EqualityContract { get; }

Property Value

Type

Handle

Gets the handle of this RemoteValue.

[JsonPropertyName("handle")]
[JsonInclude]
public string? Handle { get; }

Property Value

string

InternalId

Gets the internal ID of this RemoteValue.

[JsonPropertyName("internalId")]
[JsonInclude]
public string? InternalId { get; }

Property Value

string

Value

Gets the RemoteValueDictionary containing the key-value pairs of this remote value.

[JsonPropertyName("value")]
[JsonInclude]
[JsonConverter(typeof(RemoteValueDictionaryJsonConverter))]
public RemoteValueDictionary? Value { get; }

Property Value

RemoteValueDictionary

Remarks

This value may be null if the remote value was deserialized without a value property.

Methods

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(KeyValuePairCollectionRemoteValue?)

public virtual bool Equals(KeyValuePairCollectionRemoteValue? other)

Parameters

other KeyValuePairCollectionRemoteValue

Returns

bool

Equals(RemoteValue?)

public override sealed bool Equals(RemoteValue? other)

Parameters

other RemoteValue

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected override bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToLocalValue()

Converts this remote value to a local value for use as an argument for script execution on the remote end.

public override LocalValue ToLocalValue()

Returns

LocalValue

A LocalValue representing the key-value pair container.

Remarks

The dictionary wrapped by the returned LocalValue preserves the reference-keyed semantics of RemoteValueDictionary: string keys compare by value, while keys converted from RemoteValue objects compare by reference, so two object keys that convert to structurally identical values (for example, two distinct Date keys holding the same instant) remain distinct entries. Look such entries up by enumerating the dictionary's keys; a separately constructed, structurally equal LocalValue will not match.

Exceptions

WebDriverBiDiException

Thrown when the Value property is null.

ToRemoteObjectReference()

Converts this RemoteValue into a RemoteObjectReference.

public RemoteObjectReference ToRemoteObjectReference()

Returns

RemoteObjectReference

The RemoteObjectReference object representing this RemoteValue.

Exceptions

WebDriverBiDiException

Thrown when the RemoteValue does not have a handle set.

ToString()

public override string ToString()

Returns

string

Operators

operator ==(KeyValuePairCollectionRemoteValue?, KeyValuePairCollectionRemoteValue?)

public static bool operator ==(KeyValuePairCollectionRemoteValue? left, KeyValuePairCollectionRemoteValue? right)

Parameters

left KeyValuePairCollectionRemoteValue
right KeyValuePairCollectionRemoteValue

Returns

bool

operator !=(KeyValuePairCollectionRemoteValue?, KeyValuePairCollectionRemoteValue?)

public static bool operator !=(KeyValuePairCollectionRemoteValue? left, KeyValuePairCollectionRemoteValue? right)

Parameters

left KeyValuePairCollectionRemoteValue
right KeyValuePairCollectionRemoteValue

Returns

bool