maybeMap<TResult extends Object?> method
TResult
maybeMap<TResult extends Object?>({
- TResult allowAll()?,
- TResult allowContacts()?,
- TResult allowBots()?,
- TResult allowPremiumUsers()?,
- TResult allowUsers()?,
- TResult allowChatMembers()?,
- TResult restrictAll()?,
- TResult restrictContacts()?,
- TResult restrictBots()?,
- TResult restrictUsers()?,
- TResult restrictChatMembers()?,
- required TResult orElse(),
Implementation
TResult maybeMap<TResult extends Object?>({
TResult Function(UserPrivacySettingRuleAllowAll value)? allowAll,
TResult Function(UserPrivacySettingRuleAllowContacts value)? allowContacts,
TResult Function(UserPrivacySettingRuleAllowBots value)? allowBots,
TResult Function(UserPrivacySettingRuleAllowPremiumUsers value)?
allowPremiumUsers,
TResult Function(UserPrivacySettingRuleAllowUsers value)? allowUsers,
TResult Function(UserPrivacySettingRuleAllowChatMembers value)?
allowChatMembers,
TResult Function(UserPrivacySettingRuleRestrictAll value)? restrictAll,
TResult Function(UserPrivacySettingRuleRestrictContacts value)?
restrictContacts,
TResult Function(UserPrivacySettingRuleRestrictBots value)? restrictBots,
TResult Function(UserPrivacySettingRuleRestrictUsers value)? restrictUsers,
TResult Function(UserPrivacySettingRuleRestrictChatMembers value)?
restrictChatMembers,
required TResult Function() orElse,
}) {
switch (getConstructor()) {
case UserPrivacySettingRuleAllowAll.constructor:
if (allowAll != null) {
return allowAll.call(this as UserPrivacySettingRuleAllowAll);
}
break;
case UserPrivacySettingRuleAllowContacts.constructor:
if (allowContacts != null) {
return allowContacts
.call(this as UserPrivacySettingRuleAllowContacts);
}
break;
case UserPrivacySettingRuleAllowBots.constructor:
if (allowBots != null) {
return allowBots.call(this as UserPrivacySettingRuleAllowBots);
}
break;
case UserPrivacySettingRuleAllowPremiumUsers.constructor:
if (allowPremiumUsers != null) {
return allowPremiumUsers
.call(this as UserPrivacySettingRuleAllowPremiumUsers);
}
break;
case UserPrivacySettingRuleAllowUsers.constructor:
if (allowUsers != null) {
return allowUsers.call(this as UserPrivacySettingRuleAllowUsers);
}
break;
case UserPrivacySettingRuleAllowChatMembers.constructor:
if (allowChatMembers != null) {
return allowChatMembers
.call(this as UserPrivacySettingRuleAllowChatMembers);
}
break;
case UserPrivacySettingRuleRestrictAll.constructor:
if (restrictAll != null) {
return restrictAll.call(this as UserPrivacySettingRuleRestrictAll);
}
break;
case UserPrivacySettingRuleRestrictContacts.constructor:
if (restrictContacts != null) {
return restrictContacts
.call(this as UserPrivacySettingRuleRestrictContacts);
}
break;
case UserPrivacySettingRuleRestrictBots.constructor:
if (restrictBots != null) {
return restrictBots.call(this as UserPrivacySettingRuleRestrictBots);
}
break;
case UserPrivacySettingRuleRestrictUsers.constructor:
if (restrictUsers != null) {
return restrictUsers
.call(this as UserPrivacySettingRuleRestrictUsers);
}
break;
case UserPrivacySettingRuleRestrictChatMembers.constructor:
if (restrictChatMembers != null) {
return restrictChatMembers
.call(this as UserPrivacySettingRuleRestrictChatMembers);
}
break;
}
return orElse.call();
}