OneOf5<A, B, C, D, E> class final

Typed union of 5 variants.

Annotations

Constructors

OneOf5.a(A value)
Wraps a value of variant A.
const
OneOf5.b(B value)
Wraps a value of variant B.
const
OneOf5.c(C value)
Wraps a value of variant C.
const
OneOf5.d(D value)
Wraps a value of variant D.
const
OneOf5.e(E value)
Wraps a value of variant E.
const
OneOf5.from(Object? value)
Wraps a typed value, matching by runtime type.
factory

Properties

hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value Object?
The wrapped value.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Object?
Serializes to JSON. Primitives pass through; objects use toJson().
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

parse<A, B, C, D, E>(Object? json, {required A fromA(Object), required B fromB(Object), required C fromC(Object), required D fromD(Object), required E fromE(Object)}) OneOf5<A, B, C, D, E>
Deserializes from JSON using typed parsers.