mirror of
https://bitbucket.org/FransoletThomas/tablet-app.git
synced 2025-12-06 08:31:19 +00:00
81 lines
2.3 KiB
Dart
81 lines
2.3 KiB
Dart
//
|
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
|
//
|
|
// @dart=2.0
|
|
|
|
// ignore_for_file: unused_element, unused_import
|
|
// ignore_for_file: always_put_required_named_parameters_first
|
|
// ignore_for_file: lines_longer_than_80_chars
|
|
|
|
part of openapi.api;
|
|
|
|
class TranslationDTO {
|
|
/// Returns a new [TranslationDTO] instance.
|
|
TranslationDTO({
|
|
this.language,
|
|
this.value,
|
|
});
|
|
|
|
String language;
|
|
|
|
String value;
|
|
|
|
@override
|
|
bool operator ==(Object other) => identical(this, other) || other is TranslationDTO &&
|
|
other.language == language &&
|
|
other.value == value;
|
|
|
|
@override
|
|
int get hashCode =>
|
|
(language == null ? 0 : language.hashCode) +
|
|
(value == null ? 0 : value.hashCode);
|
|
|
|
@override
|
|
String toString() => 'TranslationDTO[language=$language, value=$value]';
|
|
|
|
Map<String, dynamic> toJson() {
|
|
final json = <String, dynamic>{};
|
|
if (language != null) {
|
|
json[r'language'] = language;
|
|
}
|
|
if (value != null) {
|
|
json[r'value'] = value;
|
|
}
|
|
return json;
|
|
}
|
|
|
|
/// Returns a new [TranslationDTO] instance and imports its values from
|
|
/// [json] if it's non-null, null if [json] is null.
|
|
static TranslationDTO fromJson(Map<String, dynamic> json) => json == null
|
|
? null
|
|
: TranslationDTO(
|
|
language: json[r'language'],
|
|
value: json[r'value'],
|
|
);
|
|
|
|
static List<TranslationDTO> listFromJson(List<dynamic> json, {bool emptyIsNull, bool growable,}) =>
|
|
json == null || json.isEmpty
|
|
? true == emptyIsNull ? null : <TranslationDTO>[]
|
|
: json.map((v) => TranslationDTO.fromJson(v)).toList(growable: true == growable);
|
|
|
|
static Map<String, TranslationDTO> mapFromJson(Map<String, dynamic> json) {
|
|
final map = <String, TranslationDTO>{};
|
|
if (json != null && json.isNotEmpty) {
|
|
json.forEach((String key, dynamic v) => map[key] = TranslationDTO.fromJson(v));
|
|
}
|
|
return map;
|
|
}
|
|
|
|
// maps a json object with a list of TranslationDTO-objects as value to a dart map
|
|
static Map<String, List<TranslationDTO>> mapListFromJson(Map<String, dynamic> json, {bool emptyIsNull, bool growable,}) {
|
|
final map = <String, List<TranslationDTO>>{};
|
|
if (json != null && json.isNotEmpty) {
|
|
json.forEach((String key, dynamic v) {
|
|
map[key] = TranslationDTO.listFromJson(v, emptyIsNull: emptyIsNull, growable: growable);
|
|
});
|
|
}
|
|
return map;
|
|
}
|
|
}
|
|
|