platform/angel_orm_generator/test/models/tree.g.dart
2018-12-03 08:41:14 -05:00

62 lines
1.5 KiB
Dart

// GENERATED CODE - DO NOT MODIFY BY HAND
part of angel_orm_generator.test.models.tree;
// **************************************************************************
// JsonModelGenerator
// **************************************************************************
@generatedSerializable
class Tree extends _Tree {
Tree(
{this.id, this.rings, List<Fruit> fruits, this.createdAt, this.updatedAt})
: this.fruits = new List.unmodifiable(fruits ?? []);
@override
final String id;
@override
final int rings;
@override
final List<Fruit> fruits;
@override
final DateTime createdAt;
@override
final DateTime updatedAt;
Tree copyWith(
{String id,
int rings,
List<Fruit> fruits,
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 &&
const ListEquality<Fruit>(const DefaultEquality<Fruit>())
.equals(other.fruits, fruits) &&
other.createdAt == createdAt &&
other.updatedAt == updatedAt;
}
@override
int get hashCode {
return hashObjects([id, rings, fruits, createdAt, updatedAt]);
}
Map<String, dynamic> toJson() {
return TreeSerializer.toMap(this);
}
}