platform/angel_orm_generator/test/models/tree.g.dart

63 lines
1.5 KiB
Dart
Raw Normal View History

2018-08-24 13:42:09 +00:00
// GENERATED CODE - DO NOT MODIFY BY HAND
part of angel_orm_generator.test.models.tree;
// **************************************************************************
// JsonModelGenerator
// **************************************************************************
@generatedSerializable
class Tree extends _Tree {
Tree(
2018-12-03 13:41:14 +00:00
{this.id, this.rings, List<Fruit> fruits, this.createdAt, this.updatedAt})
2018-08-24 13:42:09 +00:00
: this.fruits = new List.unmodifiable(fruits ?? []);
@override
final String id;
@override
final int rings;
@override
2018-12-03 13:41:14 +00:00
final List<Fruit> fruits;
2018-08-24 13:42:09 +00:00
@override
final DateTime createdAt;
@override
final DateTime updatedAt;
Tree copyWith(
{String id,
int rings,
2018-12-03 13:41:14 +00:00
List<Fruit> fruits,
2018-08-24 13:42:09 +00:00
DateTime createdAt,
DateTime updatedAt}) {
return new Tree(
id: id ?? this.id,
rings: rings ?? this.rings,
fruits: fruits ?? this.fruits,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt);
}
bool operator ==(other) {
return other is _Tree &&
other.id == id &&
other.rings == rings &&
2018-12-03 13:41:14 +00:00
const ListEquality<Fruit>(const DefaultEquality<Fruit>())
2018-08-24 13:42:09 +00:00
.equals(other.fruits, fruits) &&
other.createdAt == createdAt &&
other.updatedAt == updatedAt;
}
2018-12-01 19:03:43 +00:00
@override
int get hashCode {
return hashObjects([id, rings, fruits, createdAt, updatedAt]);
}
2018-08-24 13:42:09 +00:00
Map<String, dynamic> toJson() {
return TreeSerializer.toMap(this);
}
}