Skip to content

Commit

Permalink
minor refactoring (deriv-com#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
abedelaziz-deriv authored Aug 27, 2024
1 parent ec51577 commit 909a787
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion lib/services/connection/api_manager/connection_information.dart
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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;
}

0 comments on commit 909a787

Please sign in to comment.