diff --git a/lib/services/connection/api_manager/connection_information.dart b/lib/services/connection/api_manager/connection_information.dart index 69a808d69a..2b81531fc1 100644 --- a/lib/services/connection/api_manager/connection_information.dart +++ b/lib/services/connection/api_manager/connection_information.dart @@ -1,7 +1,10 @@ +import 'package:meta/meta.dart'; + /// Connection information for a single connection. +@immutable class ConnectionInformation { /// Initializes a new instance of the [ConnectionInformation] class. - ConnectionInformation({ + const ConnectionInformation({ required this.appId, required this.brand, required this.endpoint, @@ -23,4 +26,23 @@ class ConnectionInformation { /// API language. final String language; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ConnectionInformation && + runtimeType == other.runtimeType && + appId == other.appId && + brand == other.brand && + endpoint == other.endpoint && + authEndpoint == other.authEndpoint && + language == other.language; + + @override + int get hashCode => + appId.hashCode ^ + brand.hashCode ^ + endpoint.hashCode ^ + authEndpoint.hashCode ^ + language.hashCode; }