SimpleCloudNotifier/flutter/lib/state/application_log.g.dart

111 lines
2.6 KiB
Dart
Raw Permalink Normal View History

2024-05-25 18:09:39 +02:00
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'application_log.dart';
// **************************************************************************
// TypeAdapterGenerator
// **************************************************************************
class SCNLogAdapter extends TypeAdapter<SCNLog> {
@override
final int typeId = 101;
@override
SCNLog read(BinaryReader reader) {
final numOfFields = reader.readByte();
final fields = <int, dynamic>{
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
};
return SCNLog(
2024-05-26 00:20:25 +02:00
id: fields[0] as String,
timestamp: fields[10] as DateTime,
level: fields[11] as SCNLogLevel,
message: fields[12] as String,
additional: fields[13] as String,
trace: fields[14] as String,
2024-05-25 18:09:39 +02:00
);
}
@override
void write(BinaryWriter writer, SCNLog obj) {
writer
2024-05-26 00:20:25 +02:00
..writeByte(6)
2024-05-25 18:09:39 +02:00
..writeByte(0)
2024-05-26 00:20:25 +02:00
..write(obj.id)
..writeByte(10)
2024-05-25 18:09:39 +02:00
..write(obj.timestamp)
2024-05-26 00:20:25 +02:00
..writeByte(11)
2024-05-25 18:09:39 +02:00
..write(obj.level)
2024-05-26 00:20:25 +02:00
..writeByte(12)
2024-05-25 18:09:39 +02:00
..write(obj.message)
2024-05-26 00:20:25 +02:00
..writeByte(13)
2024-05-25 18:09:39 +02:00
..write(obj.additional)
2024-05-26 00:20:25 +02:00
..writeByte(14)
2024-05-25 18:09:39 +02:00
..write(obj.trace);
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is SCNLogAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}
2024-05-26 00:20:25 +02:00
class SCNLogLevelAdapter extends TypeAdapter<SCNLogLevel> {
@override
final int typeId = 103;
@override
SCNLogLevel read(BinaryReader reader) {
switch (reader.readByte()) {
case 0:
return SCNLogLevel.debug;
case 1:
return SCNLogLevel.info;
case 2:
return SCNLogLevel.warning;
case 3:
return SCNLogLevel.error;
case 4:
return SCNLogLevel.fatal;
default:
return SCNLogLevel.debug;
}
}
@override
void write(BinaryWriter writer, SCNLogLevel obj) {
switch (obj) {
case SCNLogLevel.debug:
writer.writeByte(0);
break;
case SCNLogLevel.info:
writer.writeByte(1);
break;
case SCNLogLevel.warning:
writer.writeByte(2);
break;
case SCNLogLevel.error:
writer.writeByte(3);
break;
case SCNLogLevel.fatal:
writer.writeByte(4);
break;
}
}
@override
int get hashCode => typeId.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is SCNLogLevelAdapter &&
runtimeType == other.runtimeType &&
typeId == other.typeId;
}