whenOrNull<TResult extends Object?> method
- @optionalTypeArgs
- TResult? read()?,
- TResult? vRead()?,
- TResult? update()?,
- TResult? patch()?,
- TResult? delete()?,
- TResult? create()?,
- TResult? search(
- Uri base,
- R4ResourceType type,
- bool? pretty,
- Summary summary,
- String? format,
- List<
String> elements, - List<
String> parameters, - bool usePost,
- RestfulRequest restfulRequest,
- MimeType? mimeType,
- String accept,
- @JsonKey.new(includeFromJson: false, includeToJson: false) Client? client,
- Map<
String, String> ? headers,
- TResult? searchAll()?,
- TResult? capabilities()?,
- TResult? transaction()?,
- TResult? batch()?,
- TResult? history(
- Uri base,
- R4ResourceType type,
- String fhirId,
- bool? pretty,
- Summary summary,
- String? format,
- List<
String> elements, - List<
String> parameters, - int? count,
- FhirInstant? since,
- FhirDateTime? at,
- String? reference,
- MimeType? mimeType,
- String accept,
- @JsonKey.new(includeFromJson: false, includeToJson: false) Client? client,
- Map<
String, String> ? headers,
- TResult? historyType(
- Uri base,
- R4ResourceType type,
- bool? pretty,
- Summary summary,
- String? format,
- List<
String> elements, - List<
String> parameters, - int? count,
- FhirInstant? since,
- FhirDateTime? at,
- String? reference,
- MimeType? mimeType,
- String accept,
- @JsonKey.new(includeFromJson: false, includeToJson: false) Client? client,
- Map<
String, String> ? headers,
- TResult? historyAll(
- Uri base,
- bool? pretty,
- Summary summary,
- String? format,
- List<
String> elements, - List<
String> parameters, - int? count,
- FhirInstant? since,
- FhirDateTime? at,
- String? reference,
- MimeType? mimeType,
- String accept,
- @JsonKey.new(includeFromJson: false, includeToJson: false) Client? client,
- Map<
String, String> ? headers,
- TResult? operation(
- Uri base,
- R4ResourceType? type,
- String? fhirId,
- bool? pretty,
- Summary summary,
- String? format,
- List<
String> elements, - List<
String> parameters, - Parameters? fhirParameter,
- String operation,
- bool usePost,
- bool useFormData,
- MimeType? mimeType,
- String accept,
- @JsonKey.new(includeFromJson: false, includeToJson: false) Client? client,
- Map<
String, String> ? headers,
A variant of when that fallback to returning null
It is equivalent to doing:
switch (sealedClass) {
case Subclass(:final field):
return ...;
case _:
return null;
}
Implementation
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>({TResult? Function( Uri base, R4ResourceType type, String fhirId, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? read,TResult? Function( Uri base, R4ResourceType type, String fhirId, FhirId vid, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? vRead,TResult? Function( Uri base, Resource resource, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? update,TResult? Function( Uri base, Resource resource, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? patch,TResult? Function( Uri base, R4ResourceType type, String fhirId, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? delete,TResult? Function( Uri base, Resource resource, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? create,TResult? Function( Uri base, R4ResourceType type, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, bool usePost, RestfulRequest restfulRequest, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? search,TResult? Function( Uri base, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? searchAll,TResult? Function( Uri base, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, Mode mode, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? capabilities,TResult? Function( Uri base, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, Bundle bundle, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? transaction,TResult? Function( Uri base, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, Bundle bundle, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? batch,TResult? Function( Uri base, R4ResourceType type, String fhirId, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, int? count, FhirInstant? since, FhirDateTime? at, String? reference, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? history,TResult? Function( Uri base, R4ResourceType type, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, int? count, FhirInstant? since, FhirDateTime? at, String? reference, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? historyType,TResult? Function( Uri base, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, int? count, FhirInstant? since, FhirDateTime? at, String? reference, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? historyAll,TResult? Function( Uri base, R4ResourceType? type, String? fhirId, bool? pretty, Summary summary, String? format, List<String> elements, List<String> parameters, Parameters? fhirParameter, String operation, bool usePost, bool useFormData, MimeType? mimeType, String accept, @JsonKey(includeFromJson: false, includeToJson: false) Client? client, Map<String, String>? headers)? operation,}) {final _that = this;
switch (_that) {
case FhirReadRequest() when read != null:
return read(_that.base,_that.type,_that.fhirId,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.mimeType,_that.accept,_that.client,_that.headers);case FhirVReadRequest() when vRead != null:
return vRead(_that.base,_that.type,_that.fhirId,_that.vid,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.mimeType,_that.accept,_that.client,_that.headers);case FhirUpdateRequest() when update != null:
return update(_that.base,_that.resource,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.mimeType,_that.accept,_that.client,_that.headers);case FhirPatchRequest() when patch != null:
return patch(_that.base,_that.resource,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.mimeType,_that.accept,_that.client,_that.headers);case FhirDeleteRequest() when delete != null:
return delete(_that.base,_that.type,_that.fhirId,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.mimeType,_that.accept,_that.client,_that.headers);case FhirCreateRequest() when create != null:
return create(_that.base,_that.resource,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.mimeType,_that.accept,_that.client,_that.headers);case FhirSearchRequest() when search != null:
return search(_that.base,_that.type,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.usePost,_that.restfulRequest,_that.mimeType,_that.accept,_that.client,_that.headers);case FhirSearchAllRequest() when searchAll != null:
return searchAll(_that.base,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.mimeType,_that.accept,_that.client,_that.headers);case FhirCapabilitiesRequest() when capabilities != null:
return capabilities(_that.base,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.mode,_that.mimeType,_that.accept,_that.client,_that.headers);case FhirTransactionRequest() when transaction != null:
return transaction(_that.base,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.bundle,_that.mimeType,_that.accept,_that.client,_that.headers);case FhirBatchRequest() when batch != null:
return batch(_that.base,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.bundle,_that.mimeType,_that.accept,_that.client,_that.headers);case FhirHistoryRequest() when history != null:
return history(_that.base,_that.type,_that.fhirId,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.count,_that.since,_that.at,_that.reference,_that.mimeType,_that.accept,_that.client,_that.headers);case FhirHistoryTypeRequest() when historyType != null:
return historyType(_that.base,_that.type,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.count,_that.since,_that.at,_that.reference,_that.mimeType,_that.accept,_that.client,_that.headers);case FhirHistoryAllRequest() when historyAll != null:
return historyAll(_that.base,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.count,_that.since,_that.at,_that.reference,_that.mimeType,_that.accept,_that.client,_that.headers);case FhirOperationRequest() when operation != null:
return operation(_that.base,_that.type,_that.fhirId,_that.pretty,_that.summary,_that.format,_that.elements,_that.parameters,_that.fhirParameter,_that.operation,_that.usePost,_that.useFormData,_that.mimeType,_that.accept,_that.client,_that.headers);case _:
return null;
}
}