Skip to content

Commit

Permalink
remove *Impl casts
Browse files Browse the repository at this point in the history
  • Loading branch information
InsanusMokrassar committed Jan 5, 2021
1 parent 6cf8d47 commit c091098
Showing 1 changed file with 0 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,6 @@ inline fun Chat.asExtendedBot(): ExtendedBot? = this as? ExtendedBot
inline fun Chat.requireExtendedBot(): ExtendedBot = this as ExtendedBot
inline fun Chat.asUser(): User? = this as? User
inline fun Chat.requireUser(): User = this as User
inline fun Chat.asChannelChatImpl(): ChannelChatImpl? = this as? ChannelChatImpl
inline fun Chat.requireChannelChatImpl(): ChannelChatImpl = this as ChannelChatImpl
inline fun Chat.asGroupChatImpl(): GroupChatImpl? = this as? GroupChatImpl
inline fun Chat.requireGroupChatImpl(): GroupChatImpl = this as GroupChatImpl
inline fun Chat.asPrivateChatImpl(): PrivateChatImpl? = this as? PrivateChatImpl
inline fun Chat.requirePrivateChatImpl(): PrivateChatImpl = this as PrivateChatImpl
inline fun Chat.asSupergroupChatImpl(): SupergroupChatImpl? = this as? SupergroupChatImpl
inline fun Chat.requireSupergroupChatImpl(): SupergroupChatImpl = this as SupergroupChatImpl
inline fun Chat.asChannelChat(): ChannelChat? = this as? ChannelChat
inline fun Chat.requireChannelChat(): ChannelChat = this as ChannelChat
inline fun Chat.asGroupChat(): GroupChat? = this as? GroupChat
Expand Down Expand Up @@ -89,14 +81,6 @@ inline fun Chat.asExtendedPublicChat(): ExtendedPublicChat? = this as? ExtendedP
inline fun Chat.requireExtendedPublicChat(): ExtendedPublicChat = this as ExtendedPublicChat
inline fun Chat.asExtendedSupergroupChat(): ExtendedSupergroupChat? = this as? ExtendedSupergroupChat
inline fun Chat.requireExtendedSupergroupChat(): ExtendedSupergroupChat = this as ExtendedSupergroupChat
inline fun Chat.asExtendedChannelChatImpl(): ExtendedChannelChatImpl? = this as? ExtendedChannelChatImpl
inline fun Chat.requireExtendedChannelChatImpl(): ExtendedChannelChatImpl = this as ExtendedChannelChatImpl
inline fun Chat.asExtendedGroupChatImpl(): ExtendedGroupChatImpl? = this as? ExtendedGroupChatImpl
inline fun Chat.requireExtendedGroupChatImpl(): ExtendedGroupChatImpl = this as ExtendedGroupChatImpl
inline fun Chat.asExtendedPrivateChatImpl(): ExtendedPrivateChatImpl? = this as? ExtendedPrivateChatImpl
inline fun Chat.requireExtendedPrivateChatImpl(): ExtendedPrivateChatImpl = this as ExtendedPrivateChatImpl
inline fun Chat.asExtendedSupergroupChatImpl(): ExtendedSupergroupChatImpl? = this as? ExtendedSupergroupChatImpl
inline fun Chat.requireExtendedSupergroupChatImpl(): ExtendedSupergroupChatImpl = this as ExtendedSupergroupChatImpl
inline fun CallbackQuery.asDataCallbackQuery(): DataCallbackQuery? = this as? DataCallbackQuery
inline fun CallbackQuery.requireDataCallbackQuery(): DataCallbackQuery = this as DataCallbackQuery
inline fun CallbackQuery.asGameShortNameCallbackQuery(): GameShortNameCallbackQuery? = this as? GameShortNameCallbackQuery
Expand All @@ -115,26 +99,16 @@ inline fun CallbackQuery.asMessageGameShortNameCallbackQuery(): MessageGameShort
inline fun CallbackQuery.requireMessageGameShortNameCallbackQuery(): MessageGameShortNameCallbackQuery = this as MessageGameShortNameCallbackQuery
inline fun CallbackQuery.asUnknownCallbackQueryType(): UnknownCallbackQueryType? = this as? UnknownCallbackQueryType
inline fun CallbackQuery.requireUnknownCallbackQueryType(): UnknownCallbackQueryType = this as UnknownCallbackQueryType
inline fun Message.asAnonymousGroupMessageImpl(): AnonymousGroupMessageImpl<MessageContent>? = this as? AnonymousGroupMessageImpl<MessageContent>
inline fun Message.requireAnonymousGroupMessageImpl(): AnonymousGroupMessageImpl<MessageContent> = this as AnonymousGroupMessageImpl<MessageContent>
inline fun Message.asChannelEventMessage(): ChannelEventMessage<ChannelEvent>? = this as? ChannelEventMessage<ChannelEvent>
inline fun Message.requireChannelEventMessage(): ChannelEventMessage<ChannelEvent> = this as ChannelEventMessage<ChannelEvent>
inline fun Message.asChannelMediaGroupMessage(): ChannelMediaGroupMessage? = this as? ChannelMediaGroupMessage
inline fun Message.requireChannelMediaGroupMessage(): ChannelMediaGroupMessage = this as ChannelMediaGroupMessage
inline fun Message.asChannelMessageImpl(): ChannelMessageImpl<MessageContent>? = this as? ChannelMessageImpl<MessageContent>
inline fun Message.requireChannelMessageImpl(): ChannelMessageImpl<MessageContent> = this as ChannelMessageImpl<MessageContent>
inline fun Message.asCommonGroupEventMessage(): CommonGroupEventMessage<GroupEvent>? = this as? CommonGroupEventMessage<GroupEvent>
inline fun Message.requireCommonGroupEventMessage(): CommonGroupEventMessage<GroupEvent> = this as CommonGroupEventMessage<GroupEvent>
inline fun Message.asCommonGroupMessageImpl(): CommonGroupMessageImpl<MessageContent>? = this as? CommonGroupMessageImpl<MessageContent>
inline fun Message.requireCommonGroupMessageImpl(): CommonGroupMessageImpl<MessageContent> = this as CommonGroupMessageImpl<MessageContent>
inline fun Message.asCommonMediaGroupMessage(): CommonMediaGroupMessage? = this as? CommonMediaGroupMessage
inline fun Message.requireCommonMediaGroupMessage(): CommonMediaGroupMessage = this as CommonMediaGroupMessage
inline fun Message.asCommonSupergroupEventMessage(): CommonSupergroupEventMessage<SupergroupEvent>? = this as? CommonSupergroupEventMessage<SupergroupEvent>
inline fun Message.requireCommonSupergroupEventMessage(): CommonSupergroupEventMessage<SupergroupEvent> = this as CommonSupergroupEventMessage<SupergroupEvent>
inline fun Message.asFromChannelGroupMessageImpl(): FromChannelGroupMessageImpl<MessageContent>? = this as? FromChannelGroupMessageImpl<MessageContent>
inline fun Message.requireFromChannelGroupMessageImpl(): FromChannelGroupMessageImpl<MessageContent> = this as FromChannelGroupMessageImpl<MessageContent>
inline fun Message.asPrivateMessageImpl(): PrivateMessageImpl<MessageContent>? = this as? PrivateMessageImpl<MessageContent>
inline fun Message.requirePrivateMessageImpl(): PrivateMessageImpl<MessageContent> = this as PrivateMessageImpl<MessageContent>
inline fun Message.asAnonymousGroupMessage(): AnonymousGroupMessage<MessageContent>? = this as? AnonymousGroupMessage<MessageContent>
inline fun Message.requireAnonymousGroupMessage(): AnonymousGroupMessage<MessageContent> = this as AnonymousGroupMessage<MessageContent>
inline fun Message.asChannelMessage(): ChannelMessage<MessageContent>? = this as? ChannelMessage<MessageContent>
Expand Down Expand Up @@ -207,44 +181,16 @@ inline fun InputMessageContent.asInputVenueMessageContent(): InputVenueMessageCo
inline fun InputMessageContent.requireInputVenueMessageContent(): InputVenueMessageContent = this as InputVenueMessageContent
inline fun InlineQueryResult.asInlineQueryResultArticle(): InlineQueryResultArticle? = this as? InlineQueryResultArticle
inline fun InlineQueryResult.requireInlineQueryResultArticle(): InlineQueryResultArticle = this as InlineQueryResultArticle
inline fun InlineQueryResult.asInlineQueryResultAudioCachedImpl(): InlineQueryResultAudioCachedImpl? = this as? InlineQueryResultAudioCachedImpl
inline fun InlineQueryResult.requireInlineQueryResultAudioCachedImpl(): InlineQueryResultAudioCachedImpl = this as InlineQueryResultAudioCachedImpl
inline fun InlineQueryResult.asInlineQueryResultAudioImpl(): InlineQueryResultAudioImpl? = this as? InlineQueryResultAudioImpl
inline fun InlineQueryResult.requireInlineQueryResultAudioImpl(): InlineQueryResultAudioImpl = this as InlineQueryResultAudioImpl
inline fun InlineQueryResult.asInlineQueryResultContact(): InlineQueryResultContact? = this as? InlineQueryResultContact
inline fun InlineQueryResult.requireInlineQueryResultContact(): InlineQueryResultContact = this as InlineQueryResultContact
inline fun InlineQueryResult.asInlineQueryResultDocumentCachedImpl(): InlineQueryResultDocumentCachedImpl? = this as? InlineQueryResultDocumentCachedImpl
inline fun InlineQueryResult.requireInlineQueryResultDocumentCachedImpl(): InlineQueryResultDocumentCachedImpl = this as InlineQueryResultDocumentCachedImpl
inline fun InlineQueryResult.asInlineQueryResultDocumentImpl(): InlineQueryResultDocumentImpl? = this as? InlineQueryResultDocumentImpl
inline fun InlineQueryResult.requireInlineQueryResultDocumentImpl(): InlineQueryResultDocumentImpl = this as InlineQueryResultDocumentImpl
inline fun InlineQueryResult.asInlineQueryResultGame(): InlineQueryResultGame? = this as? InlineQueryResultGame
inline fun InlineQueryResult.requireInlineQueryResultGame(): InlineQueryResultGame = this as InlineQueryResultGame
inline fun InlineQueryResult.asInlineQueryResultGifCachedImpl(): InlineQueryResultGifCachedImpl? = this as? InlineQueryResultGifCachedImpl
inline fun InlineQueryResult.requireInlineQueryResultGifCachedImpl(): InlineQueryResultGifCachedImpl = this as InlineQueryResultGifCachedImpl
inline fun InlineQueryResult.asInlineQueryResultGifImpl(): InlineQueryResultGifImpl? = this as? InlineQueryResultGifImpl
inline fun InlineQueryResult.requireInlineQueryResultGifImpl(): InlineQueryResultGifImpl = this as InlineQueryResultGifImpl
inline fun InlineQueryResult.asInlineQueryResultLocation(): InlineQueryResultLocation? = this as? InlineQueryResultLocation
inline fun InlineQueryResult.requireInlineQueryResultLocation(): InlineQueryResultLocation = this as InlineQueryResultLocation
inline fun InlineQueryResult.asInlineQueryResultMpeg4GifCachedImpl(): InlineQueryResultMpeg4GifCachedImpl? = this as? InlineQueryResultMpeg4GifCachedImpl
inline fun InlineQueryResult.requireInlineQueryResultMpeg4GifCachedImpl(): InlineQueryResultMpeg4GifCachedImpl = this as InlineQueryResultMpeg4GifCachedImpl
inline fun InlineQueryResult.asInlineQueryResultMpeg4GifImpl(): InlineQueryResultMpeg4GifImpl? = this as? InlineQueryResultMpeg4GifImpl
inline fun InlineQueryResult.requireInlineQueryResultMpeg4GifImpl(): InlineQueryResultMpeg4GifImpl = this as InlineQueryResultMpeg4GifImpl
inline fun InlineQueryResult.asInlineQueryResultPhotoCachedImpl(): InlineQueryResultPhotoCachedImpl? = this as? InlineQueryResultPhotoCachedImpl
inline fun InlineQueryResult.requireInlineQueryResultPhotoCachedImpl(): InlineQueryResultPhotoCachedImpl = this as InlineQueryResultPhotoCachedImpl
inline fun InlineQueryResult.asInlineQueryResultPhotoImpl(): InlineQueryResultPhotoImpl? = this as? InlineQueryResultPhotoImpl
inline fun InlineQueryResult.requireInlineQueryResultPhotoImpl(): InlineQueryResultPhotoImpl = this as InlineQueryResultPhotoImpl
inline fun InlineQueryResult.asInlineQueryResultStickerCached(): InlineQueryResultStickerCached? = this as? InlineQueryResultStickerCached
inline fun InlineQueryResult.requireInlineQueryResultStickerCached(): InlineQueryResultStickerCached = this as InlineQueryResultStickerCached
inline fun InlineQueryResult.asInlineQueryResultVenue(): InlineQueryResultVenue? = this as? InlineQueryResultVenue
inline fun InlineQueryResult.requireInlineQueryResultVenue(): InlineQueryResultVenue = this as InlineQueryResultVenue
inline fun InlineQueryResult.asInlineQueryResultVideoCachedImpl(): InlineQueryResultVideoCachedImpl? = this as? InlineQueryResultVideoCachedImpl
inline fun InlineQueryResult.requireInlineQueryResultVideoCachedImpl(): InlineQueryResultVideoCachedImpl = this as InlineQueryResultVideoCachedImpl
inline fun InlineQueryResult.asInlineQueryResultVideoImpl(): InlineQueryResultVideoImpl? = this as? InlineQueryResultVideoImpl
inline fun InlineQueryResult.requireInlineQueryResultVideoImpl(): InlineQueryResultVideoImpl = this as InlineQueryResultVideoImpl
inline fun InlineQueryResult.asInlineQueryResultVoiceCachedImpl(): InlineQueryResultVoiceCachedImpl? = this as? InlineQueryResultVoiceCachedImpl
inline fun InlineQueryResult.requireInlineQueryResultVoiceCachedImpl(): InlineQueryResultVoiceCachedImpl = this as InlineQueryResultVoiceCachedImpl
inline fun InlineQueryResult.asInlineQueryResultVoiceImpl(): InlineQueryResultVoiceImpl? = this as? InlineQueryResultVoiceImpl
inline fun InlineQueryResult.requireInlineQueryResultVoiceImpl(): InlineQueryResultVoiceImpl = this as InlineQueryResultVoiceImpl
inline fun InlineQueryResult.asDescribedInlineQueryResult(): DescribedInlineQueryResult? = this as? DescribedInlineQueryResult
inline fun InlineQueryResult.requireDescribedInlineQueryResult(): DescribedInlineQueryResult = this as DescribedInlineQueryResult
inline fun InlineQueryResult.asFileInlineQueryResult(): FileInlineQueryResult? = this as? FileInlineQueryResult
Expand Down Expand Up @@ -307,8 +253,6 @@ inline fun InlineQueryResult.asInlineQueryResultVoiceCached(): InlineQueryResult
inline fun InlineQueryResult.requireInlineQueryResultVoiceCached(): InlineQueryResultVoiceCached = this as InlineQueryResultVoiceCached
inline fun InlineQueryResult.asInlineQueryResultVoiceCommon(): InlineQueryResultVoiceCommon? = this as? InlineQueryResultVoiceCommon
inline fun InlineQueryResult.requireInlineQueryResultVoiceCommon(): InlineQueryResultVoiceCommon = this as InlineQueryResultVoiceCommon
inline fun ChatMember.asAdministratorChatMemberImpl(): AdministratorChatMemberImpl? = this as? AdministratorChatMemberImpl
inline fun ChatMember.requireAdministratorChatMemberImpl(): AdministratorChatMemberImpl = this as AdministratorChatMemberImpl
inline fun ChatMember.asCreatorChatMember(): CreatorChatMember? = this as? CreatorChatMember
inline fun ChatMember.requireCreatorChatMember(): CreatorChatMember = this as CreatorChatMember
inline fun ChatMember.asKickedChatMember(): KickedChatMember? = this as? KickedChatMember
Expand Down

0 comments on commit c091098

Please sign in to comment.