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
originalKeyValuePairCollectionRemoteValue
Properties
EqualityContract
protected override Type EqualityContract { get; }
Property Value
Handle
Gets the handle of this RemoteValue.
[JsonPropertyName("handle")]
[JsonInclude]
public string? Handle { get; }
Property Value
InternalId
Gets the internal ID of this RemoteValue.
[JsonPropertyName("internalId")]
[JsonInclude]
public string? InternalId { get; }
Property Value
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
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
objobject
Returns
Equals(KeyValuePairCollectionRemoteValue?)
public virtual bool Equals(KeyValuePairCollectionRemoteValue? other)
Parameters
Returns
Equals(RemoteValue?)
public override sealed bool Equals(RemoteValue? other)
Parameters
otherRemoteValue
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected override bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
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
Operators
operator ==(KeyValuePairCollectionRemoteValue?, KeyValuePairCollectionRemoteValue?)
public static bool operator ==(KeyValuePairCollectionRemoteValue? left, KeyValuePairCollectionRemoteValue? right)
Parameters
Returns
operator !=(KeyValuePairCollectionRemoteValue?, KeyValuePairCollectionRemoteValue?)
public static bool operator !=(KeyValuePairCollectionRemoteValue? left, KeyValuePairCollectionRemoteValue? right)