selfprivacy.org.app/lib/logic/models/hive/backups_credential.g.dart

99 lines
2.5 KiB
Dart
Raw Normal View History

// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'backups_credential.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class BackupsCredentialAdapter extends TypeAdapter<BackupsCredential> {
@override
final int typeId = 4;
@override
BackupsCredential read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return BackupsCredential(
keyId: fields[0] as String,
applicationKey: fields[1] as String,
provider: fields[2] == null
2023-06-29 09:52:09 +00:00
? BackupsProviderType.backblaze
: fields[2] as BackupsProviderType,
);
}
@override
void write(BinaryWriter writer, BackupsCredential obj) {
writer
..writeByte(3)
..writeByte(0)
..write(obj.keyId)
..writeByte(1)
..write(obj.applicationKey)
..writeByte(2)
..write(obj.provider);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is BackupsCredentialAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
2023-06-29 09:52:09 +00:00
class BackupsProviderTypeAdapter extends TypeAdapter<BackupsProviderType> {
@override
final int typeId = 103;
@override
2023-06-29 09:52:09 +00:00
BackupsProviderType read(BinaryReader reader) {
switch (reader.readByte()) {
case 0:
2023-06-29 09:52:09 +00:00
return BackupsProviderType.none;
case 1:
2023-06-29 09:52:09 +00:00
return BackupsProviderType.memory;
case 2:
2023-06-29 09:52:09 +00:00
return BackupsProviderType.file;
case 3:
2023-06-29 09:52:09 +00:00
return BackupsProviderType.backblaze;
default:
2023-06-29 09:52:09 +00:00
return BackupsProviderType.none;
}
}
@override
2023-06-29 09:52:09 +00:00
void write(BinaryWriter writer, BackupsProviderType obj) {
switch (obj) {
2023-06-29 09:52:09 +00:00
case BackupsProviderType.none:
writer.writeByte(0);
break;
2023-06-29 09:52:09 +00:00
case BackupsProviderType.memory:
writer.writeByte(1);
break;
2023-06-29 09:52:09 +00:00
case BackupsProviderType.file:
writer.writeByte(2);
break;
2023-06-29 09:52:09 +00:00
case BackupsProviderType.backblaze:
writer.writeByte(3);
break;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
2023-06-29 09:52:09 +00:00
other is BackupsProviderTypeAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}