ParsedInstructionPatterns extension
Adds pattern-matching-related methods to ParsedInstruction.
Methods
-
map<
TResult extends Object?> ({required TResult system(ParsedInstructionSystem value), required TResult splToken(ParsedInstructionSplToken value), required TResult memo(ParsedInstructionMemo value), required TResult unsupported(ParsedInstructionUnsupported value)}) → TResult -
Available on ParsedInstruction, provided by the ParsedInstructionPatterns extension
Aswitch-like method, using callbacks. -
mapOrNull<
TResult extends Object?> ({TResult? system(ParsedInstructionSystem value)?, TResult? splToken(ParsedInstructionSplToken value)?, TResult? memo(ParsedInstructionMemo value)?, TResult? unsupported(ParsedInstructionUnsupported value)?}) → TResult? -
Available on ParsedInstruction, provided by the ParsedInstructionPatterns extension
A variant ofmapthat fallback to returningnull. -
maybeMap<
TResult extends Object?> ({TResult system(ParsedInstructionSystem value)?, TResult splToken(ParsedInstructionSplToken value)?, TResult memo(ParsedInstructionMemo value)?, TResult unsupported(ParsedInstructionUnsupported value)?, required TResult orElse()}) → TResult -
Available on ParsedInstruction, provided by the ParsedInstructionPatterns extension
A variant ofmapthat fallback to returningorElse. -
maybeWhen<
TResult extends Object?> ({TResult system(String programId, ParsedSystemInstruction parsed)?, TResult splToken(ParsedSplTokenInstruction parsed)?, TResult memo(String? memo)?, TResult unsupported(String? program)?, required TResult orElse()}) → TResult -
Available on ParsedInstruction, provided by the ParsedInstructionPatterns extension
A variant ofwhenthat fallback to anorElsecallback. -
when<
TResult extends Object?> ({required TResult system(String programId, ParsedSystemInstruction parsed), required TResult splToken(ParsedSplTokenInstruction parsed), required TResult memo(String? memo), required TResult unsupported(String? program)}) → TResult -
Available on ParsedInstruction, provided by the ParsedInstructionPatterns extension
Aswitch-like method, using callbacks. -
whenOrNull<
TResult extends Object?> ({TResult? system(String programId, ParsedSystemInstruction parsed)?, TResult? splToken(ParsedSplTokenInstruction parsed)?, TResult? memo(String? memo)?, TResult? unsupported(String? program)?}) → TResult? -
Available on ParsedInstruction, provided by the ParsedInstructionPatterns extension
A variant ofwhenthat fallback to returningnull