Class RemoteValue
- Namespace
- WebDriverBiDi.Script
- Assembly
- WebDriverBiDi.dll
Object representing a remote value in the browser.
[JsonConverter(typeof(DiscriminatedUnionJsonConverter<RemoteValue>))]
[DiscriminatedTypeProperty("type", UnmatchedValueType = typeof(ObjectReferenceRemoteValue))]
[DiscriminatedDerivedType(typeof(NullRemoteValue), "null")]
[DiscriminatedDerivedType(typeof(UndefinedRemoteValue), "undefined")]
[DiscriminatedDerivedType(typeof(StringRemoteValue), "string")]
[DiscriminatedDerivedType(typeof(NumberRemoteValue), "number")]
[DiscriminatedDerivedType(typeof(BooleanRemoteValue), "boolean")]
[DiscriminatedDerivedType(typeof(BigIntegerRemoteValue), "bigint")]
[DiscriminatedDerivedType(typeof(DateRemoteValue), "date")]
[DiscriminatedDerivedType(typeof(RegExpRemoteValue), "regexp")]
[DiscriminatedDerivedType(typeof(NodeRemoteValue), "node")]
[DiscriminatedDerivedType(typeof(WindowProxyRemoteValue), "window")]
[DiscriminatedDerivedType(typeof(CollectionRemoteValue), "array")]
[DiscriminatedDerivedType(typeof(CollectionRemoteValue), "set")]
[DiscriminatedDerivedType(typeof(CollectionRemoteValue), "nodelist")]
[DiscriminatedDerivedType(typeof(CollectionRemoteValue), "htmlcollection")]
[DiscriminatedDerivedType(typeof(KeyValuePairCollectionRemoteValue), "object")]
[DiscriminatedDerivedType(typeof(KeyValuePairCollectionRemoteValue), "map")]
public abstract record RemoteValue : IEquatable<RemoteValue>
- Inheritance
-
RemoteValue
- Implements
- Derived
- Inherited Members
Constructors
RemoteValue(RemoteValue)
protected RemoteValue(RemoteValue original)
Parameters
originalRemoteValue
Properties
EqualityContract
protected virtual Type EqualityContract { get; }
Property Value
Type
Gets the type of this RemoteValue.
[JsonPropertyName("type")]
[JsonInclude]
public virtual RemoteValueType Type { get; }
Property Value
Methods
As<T>()
Casts this RemoteValue to the specified type-specific RemoteValue type, throwing if it is not of that type. Use TryAs<T>(out T?) to test without throwing.
public T As<T>() where T : RemoteValue
Returns
- T
This RemoteValue, cast to the specified type-specific RemoteValue type.
Type Parameters
TThe type-specific RemoteValue type to cast to.
Exceptions
- WebDriverBiDiException
Thrown if this RemoteValue cannot be cast to the specified type.
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
Equals(RemoteValue?)
public virtual bool Equals(RemoteValue? other)
Parameters
otherRemoteValue
Returns
GetHashCode()
public override int GetHashCode()
Returns
PrintMembers(StringBuilder)
protected virtual bool PrintMembers(StringBuilder builder)
Parameters
builderStringBuilder
Returns
ToLocalValue()
Converts this RemoteValue to a LocalValue for use with sending to the protocol remote end.
public abstract LocalValue ToLocalValue()
Returns
- LocalValue
A LocalValue representing the this RemoteValue value.
ToString()
public override string ToString()
Returns
TryAs<T>(out T?)
Attempts to cast this RemoteValue to the specified type-specific RemoteValue type, returning false rather than throwing when it is not of that type.
public bool TryAs<T>(out T? result) where T : RemoteValue
Parameters
resultTWhen this method returns, contains the cast value or null if the cast failed.
Returns
Type Parameters
TThe type-specific RemoteValue type to cast to.
Operators
operator ==(RemoteValue?, RemoteValue?)
public static bool operator ==(RemoteValue? left, RemoteValue? right)
Parameters
leftRemoteValuerightRemoteValue
Returns
operator !=(RemoteValue?, RemoteValue?)
public static bool operator !=(RemoteValue? left, RemoteValue? right)
Parameters
leftRemoteValuerightRemoteValue