map<TResult extends Object?> method
- @optionalTypeArgs
- required TResult mentionRule(
- UDraftThreadgateAllowMentionRule value
- required TResult followerRule(
- UDraftThreadgateAllowFollowerRule value
- required TResult followingRule(
- UDraftThreadgateAllowFollowingRule value
- required TResult listRule(
- UDraftThreadgateAllowListRule value
- required TResult unknown(
- UDraftThreadgateAllowUnknown 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( UDraftThreadgateAllowMentionRule value) mentionRule,required TResult Function( UDraftThreadgateAllowFollowerRule value) followerRule,required TResult Function( UDraftThreadgateAllowFollowingRule value) followingRule,required TResult Function( UDraftThreadgateAllowListRule value) listRule,required TResult Function( UDraftThreadgateAllowUnknown value) unknown,}){
final _that = this;
switch (_that) {
case UDraftThreadgateAllowMentionRule():
return mentionRule(_that);case UDraftThreadgateAllowFollowerRule():
return followerRule(_that);case UDraftThreadgateAllowFollowingRule():
return followingRule(_that);case UDraftThreadgateAllowListRule():
return listRule(_that);case UDraftThreadgateAllowUnknown():
return unknown(_that);}
}