277 lines
7 KiB
Dart
277 lines
7 KiB
Dart
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
// coverage:ignore-file
|
|
// ignore_for_file: type=lint, type=warning, deprecated_member_use, deprecated_member_use_from_same_package
|
|
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
|
|
|
part of 'catalog_failure.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
// dart format off
|
|
T _$identity<T>(T value) => value;
|
|
/// @nodoc
|
|
mixin _$CatalogFailure {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is CatalogFailure);
|
|
}
|
|
|
|
|
|
@override
|
|
int get hashCode => runtimeType.hashCode;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'CatalogFailure()';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
class $CatalogFailureCopyWith<$Res> {
|
|
$CatalogFailureCopyWith(CatalogFailure _, $Res Function(CatalogFailure) __);
|
|
}
|
|
|
|
|
|
/// Adds pattern-matching-related methods to [CatalogFailure].
|
|
extension CatalogFailurePatterns on CatalogFailure {
|
|
/// A variant of `map` that fallback to returning `orElse`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs TResult maybeMap<TResult extends Object?>({TResult Function( CatalogNetworkFailure value)? network,TResult Function( CatalogInvalidInputFailure value)? invalidInput,TResult Function( CatalogUnexpectedFailure value)? unexpected,required TResult orElse(),}){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case CatalogNetworkFailure() when network != null:
|
|
return network(_that);case CatalogInvalidInputFailure() when invalidInput != null:
|
|
return invalidInput(_that);case CatalogUnexpectedFailure() when unexpected != null:
|
|
return unexpected(_that);case _:
|
|
return orElse();
|
|
|
|
}
|
|
}
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// Callbacks receives the raw object, upcasted.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case final Subclass2 value:
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs TResult map<TResult extends Object?>({required TResult Function( CatalogNetworkFailure value) network,required TResult Function( CatalogInvalidInputFailure value) invalidInput,required TResult Function( CatalogUnexpectedFailure value) unexpected,}){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case CatalogNetworkFailure():
|
|
return network(_that);case CatalogInvalidInputFailure():
|
|
return invalidInput(_that);case CatalogUnexpectedFailure():
|
|
return unexpected(_that);}
|
|
}
|
|
/// A variant of `map` that fallback to returning `null`.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case final Subclass value:
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>({TResult? Function( CatalogNetworkFailure value)? network,TResult? Function( CatalogInvalidInputFailure value)? invalidInput,TResult? Function( CatalogUnexpectedFailure value)? unexpected,}){
|
|
final _that = this;
|
|
switch (_that) {
|
|
case CatalogNetworkFailure() when network != null:
|
|
return network(_that);case CatalogInvalidInputFailure() when invalidInput != null:
|
|
return invalidInput(_that);case CatalogUnexpectedFailure() when unexpected != null:
|
|
return unexpected(_that);case _:
|
|
return null;
|
|
|
|
}
|
|
}
|
|
/// A variant of `when` that fallback to an `orElse` callback.
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return orElse();
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>({TResult Function()? network,TResult Function()? invalidInput,TResult Function()? unexpected,required TResult orElse(),}) {final _that = this;
|
|
switch (_that) {
|
|
case CatalogNetworkFailure() when network != null:
|
|
return network();case CatalogInvalidInputFailure() when invalidInput != null:
|
|
return invalidInput();case CatalogUnexpectedFailure() when unexpected != null:
|
|
return unexpected();case _:
|
|
return orElse();
|
|
|
|
}
|
|
}
|
|
/// A `switch`-like method, using callbacks.
|
|
///
|
|
/// As opposed to `map`, this offers destructuring.
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case Subclass2(:final field2):
|
|
/// return ...;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs TResult when<TResult extends Object?>({required TResult Function() network,required TResult Function() invalidInput,required TResult Function() unexpected,}) {final _that = this;
|
|
switch (_that) {
|
|
case CatalogNetworkFailure():
|
|
return network();case CatalogInvalidInputFailure():
|
|
return invalidInput();case CatalogUnexpectedFailure():
|
|
return unexpected();}
|
|
}
|
|
/// A variant of `when` that fallback to returning `null`
|
|
///
|
|
/// It is equivalent to doing:
|
|
/// ```dart
|
|
/// switch (sealedClass) {
|
|
/// case Subclass(:final field):
|
|
/// return ...;
|
|
/// case _:
|
|
/// return null;
|
|
/// }
|
|
/// ```
|
|
|
|
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>({TResult? Function()? network,TResult? Function()? invalidInput,TResult? Function()? unexpected,}) {final _that = this;
|
|
switch (_that) {
|
|
case CatalogNetworkFailure() when network != null:
|
|
return network();case CatalogInvalidInputFailure() when invalidInput != null:
|
|
return invalidInput();case CatalogUnexpectedFailure() when unexpected != null:
|
|
return unexpected();case _:
|
|
return null;
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
/// @nodoc
|
|
|
|
|
|
class CatalogNetworkFailure implements CatalogFailure {
|
|
const CatalogNetworkFailure();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is CatalogNetworkFailure);
|
|
}
|
|
|
|
|
|
@override
|
|
int get hashCode => runtimeType.hashCode;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'CatalogFailure.network()';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// @nodoc
|
|
|
|
|
|
class CatalogInvalidInputFailure implements CatalogFailure {
|
|
const CatalogInvalidInputFailure();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is CatalogInvalidInputFailure);
|
|
}
|
|
|
|
|
|
@override
|
|
int get hashCode => runtimeType.hashCode;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'CatalogFailure.invalidInput()';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// @nodoc
|
|
|
|
|
|
class CatalogUnexpectedFailure implements CatalogFailure {
|
|
const CatalogUnexpectedFailure();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) || (other.runtimeType == runtimeType&&other is CatalogUnexpectedFailure);
|
|
}
|
|
|
|
|
|
@override
|
|
int get hashCode => runtimeType.hashCode;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'CatalogFailure.unexpected()';
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// dart format on
|