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

82 lines
1.8 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.user;
// **************************************************************************
// JsonModelGenerator
// **************************************************************************
@generatedSerializable
class User extends _User {
User(
{this.id,
this.username,
this.password,
this.email,
2018-12-03 13:41:14 +00:00
List<Role> roles,
2018-08-24 13:42:09 +00:00
this.createdAt,
this.updatedAt})
: this.roles = new List.unmodifiable(roles ?? []);
@override
final String id;
@override
final String username;
@override
final String password;
@override
final String email;
@override
2018-12-03 13:41:14 +00:00
final List<Role> roles;
2018-08-24 13:42:09 +00:00
@override
final DateTime createdAt;
@override
final DateTime updatedAt;
User copyWith(
{String id,
String username,
String password,
String email,
2018-12-03 13:41:14 +00:00
List<Role> roles,
2018-08-24 13:42:09 +00:00
DateTime createdAt,
DateTime updatedAt}) {
return new User(
id: id ?? this.id,
username: username ?? this.username,
password: password ?? this.password,
email: email ?? this.email,
roles: roles ?? this.roles,
createdAt: createdAt ?? this.createdAt,
updatedAt: updatedAt ?? this.updatedAt);
}
bool operator ==(other) {
return other is _User &&
other.id == id &&
other.username == username &&
other.password == password &&
other.email == email &&
2018-12-03 13:41:14 +00:00
const ListEquality<Role>(const DefaultEquality<Role>())
2018-08-24 13:42:09 +00:00
.equals(other.roles, roles) &&
other.createdAt == createdAt &&
other.updatedAt == updatedAt;
}
2018-12-01 19:03:43 +00:00
@override
int get hashCode {
return hashObjects(
[id, username, password, email, roles, createdAt, updatedAt]);
}
2018-08-24 13:42:09 +00:00
Map<String, dynamic> toJson() {
return UserSerializer.toMap(this);
}
}