2023-10-22 20:15:34 +00:00
|
|
|
import 'package:openapi/api.dart';
|
|
|
|
|
|
|
|
|
|
class ServerVersion {
|
|
|
|
|
final int major;
|
|
|
|
|
final int minor;
|
|
|
|
|
final int patch;
|
|
|
|
|
|
2025-07-29 00:34:03 +05:30
|
|
|
const ServerVersion({required this.major, required this.minor, required this.patch});
|
|
|
|
|
|
|
|
|
|
ServerVersion copyWith({int? major, int? minor, int? patch}) {
|
|
|
|
|
return ServerVersion(major: major ?? this.major, minor: minor ?? this.minor, patch: patch ?? this.patch);
|
2023-10-22 20:15:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String toString() {
|
|
|
|
|
return 'ServerVersion(major: $major, minor: $minor, patch: $patch)';
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-29 00:34:03 +05:30
|
|
|
ServerVersion.fromDto(ServerVersionResponseDto dto) : major = dto.major, minor = dto.minor, patch = dto.patch_;
|
2023-10-22 20:15:34 +00:00
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
bool operator ==(Object other) {
|
|
|
|
|
if (identical(this, other)) return true;
|
|
|
|
|
|
2025-07-25 08:07:22 +05:30
|
|
|
return other is ServerVersion && other.major == major && other.minor == minor && other.patch == patch;
|
2023-10-22 20:15:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
int get hashCode {
|
|
|
|
|
return major.hashCode ^ minor.hashCode ^ patch.hashCode;
|
|
|
|
|
}
|
|
|
|
|
}
|