map<TResult extends Object?> method
- @optionalTypeArgs
- required TResult postView(
- UReplyRefParentPostView value
- required TResult notFoundPost(
- UReplyRefParentNotFoundPost value
- required TResult blockedPost(
- UReplyRefParentBlockedPost value
- required TResult unknown(
- UReplyRefParentUnknown value
A switch
-like method, using callbacks.
Callbacks receives the raw object, upcasted. It is equivalent to doing:
switch (sealedClass) {
case final Subclass value:
return ...;
case final Subclass2 value:
return ...;
}
Implementation
@optionalTypeArgs TResult map<TResult extends Object?>({required TResult Function( UReplyRefParentPostView value) postView,required TResult Function( UReplyRefParentNotFoundPost value) notFoundPost,required TResult Function( UReplyRefParentBlockedPost value) blockedPost,required TResult Function( UReplyRefParentUnknown value) unknown,}){
final _that = this;
switch (_that) {
case UReplyRefParentPostView():
return postView(_that);case UReplyRefParentNotFoundPost():
return notFoundPost(_that);case UReplyRefParentBlockedPost():
return blockedPost(_that);case UReplyRefParentUnknown():
return unknown(_that);}
}