replaceWith method

SessionData replaceWith({
  1. NewType<FavoriteChatsListVersion?>? favoriteChatsListVersion,
  2. NewType<bool?>? favoriteChatsSynchronized,
  3. NewType<ChatContactsListVersion?>? chatContactsListVersion,
  4. NewType<bool?>? favoriteContactsSynchronized,
  5. NewType<bool?>? contactsSynchronized,
  6. NewType<bool?>? blocklistSynchronized,
  7. NewType<SessionsListVersion?>? sessionsListVersion,
  8. NewType<BlocklistVersion?>? blocklistVersion,
  9. NewType<int?>? blocklistCount,
})

Returns a copy of this SessionData replaced with the NewTypes provided.

Implementation

SessionData replaceWith({
  NewType<FavoriteChatsListVersion?>? favoriteChatsListVersion,
  NewType<bool?>? favoriteChatsSynchronized,
  NewType<ChatContactsListVersion?>? chatContactsListVersion,
  NewType<bool?>? favoriteContactsSynchronized,
  NewType<bool?>? contactsSynchronized,
  NewType<bool?>? blocklistSynchronized,
  NewType<SessionsListVersion?>? sessionsListVersion,
  NewType<BlocklistVersion?>? blocklistVersion,
  NewType<int?>? blocklistCount,
}) {
  return SessionData(
    favoriteChatsListVersion:
        favoriteChatsListVersion == null
            ? this.favoriteChatsListVersion
            : favoriteChatsListVersion.val,
    favoriteChatsSynchronized:
        favoriteChatsSynchronized == null
            ? this.favoriteChatsSynchronized
            : favoriteChatsSynchronized.val,
    chatContactsListVersion:
        chatContactsListVersion == null
            ? this.chatContactsListVersion
            : chatContactsListVersion.val,
    favoriteContactsSynchronized:
        favoriteContactsSynchronized == null
            ? this.favoriteContactsSynchronized
            : favoriteContactsSynchronized.val,
    contactsSynchronized:
        contactsSynchronized == null
            ? this.contactsSynchronized
            : contactsSynchronized.val,
    blocklistSynchronized:
        blocklistSynchronized == null
            ? this.blocklistSynchronized
            : blocklistSynchronized.val,
    sessionsListVersion:
        sessionsListVersion == null
            ? this.sessionsListVersion
            : sessionsListVersion.val,
    blocklistVersion:
        blocklistVersion == null
            ? this.blocklistVersion
            : blocklistVersion.val,
    blocklistCount:
        blocklistCount == null ? this.blocklistCount : blocklistCount.val,
  );
}