// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'id_value_mix.dart';

// **************************************************************************
// _IsarEmbeddedGenerator
// **************************************************************************

// coverage:ignore-file
// ignore_for_file: duplicate_ignore, invalid_use_of_protected_member, lines_longer_than_80_chars, constant_identifier_names, avoid_js_rounded_ints, no_leading_underscores_for_local_identifiers, require_trailing_commas, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_in_if_null_operators, library_private_types_in_public_api, prefer_const_constructors
// ignore_for_file: type=lint

const IdValueMixSchema = IsarGeneratedSchema(
  schema: IsarSchema(
    name: 'IdValueMix',
    embedded: true,
    properties: [
      IsarPropertySchema(
        name: 'id',
        type: IsarType.long,
      ),
      IsarPropertySchema(
        name: 'value',
        type: IsarType.object,
        target: 'IdValueColor',
      ),
    ],
    indexes: [],
  ),
  converter: IsarObjectConverter<void, IdValueMix>(
    serialize: serializeIdValueMix,
    deserialize: deserializeIdValueMix,
  ),
);

@isarProtected
int serializeIdValueMix(IsarWriter writer, IdValueMix object) {
  IsarCore.writeLong(writer, 1, object.id ?? -9223372036854775808);
  {
    final value = object.value;
    if (value == null) {
      IsarCore.writeNull(writer, 2);
    } else {
      final objectWriter = IsarCore.beginObject(writer, 2);
      serializeIdValueColor(objectWriter, value);
      IsarCore.endObject(writer, objectWriter);
    }
  }
  return 0;
}

@isarProtected
IdValueMix deserializeIdValueMix(IsarReader reader) {
  final object = IdValueMix();
  {
    final value = IsarCore.readLong(reader, 1);
    if (value == -9223372036854775808) {
      object.id = null;
    } else {
      object.id = value;
    }
  }
  {
    final objectReader = IsarCore.readObject(reader, 2);
    if (objectReader.isNull) {
      object.value = null;
    } else {
      final embedded = deserializeIdValueColor(objectReader);
      IsarCore.freeReader(objectReader);
      object.value = embedded;
    }
  }
  return object;
}

extension IdValueMixQueryFilter
    on QueryBuilder<IdValueMix, IdValueMix, QFilterCondition> {
  QueryBuilder<IdValueMix, IdValueMix, QAfterFilterCondition> idIsNull() {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(const IsNullCondition(property: 1));
    });
  }

  QueryBuilder<IdValueMix, IdValueMix, QAfterFilterCondition> idIsNotNull() {
    return QueryBuilder.apply(not(), (query) {
      return query.addFilterCondition(const IsNullCondition(property: 1));
    });
  }

  QueryBuilder<IdValueMix, IdValueMix, QAfterFilterCondition> idEqualTo(
    int? value,
  ) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        EqualCondition(
          property: 1,
          value: value,
        ),
      );
    });
  }

  QueryBuilder<IdValueMix, IdValueMix, QAfterFilterCondition> idGreaterThan(
    int? value,
  ) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        GreaterCondition(
          property: 1,
          value: value,
        ),
      );
    });
  }

  QueryBuilder<IdValueMix, IdValueMix, QAfterFilterCondition>
      idGreaterThanOrEqualTo(
    int? value,
  ) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        GreaterOrEqualCondition(
          property: 1,
          value: value,
        ),
      );
    });
  }

  QueryBuilder<IdValueMix, IdValueMix, QAfterFilterCondition> idLessThan(
    int? value,
  ) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        LessCondition(
          property: 1,
          value: value,
        ),
      );
    });
  }

  QueryBuilder<IdValueMix, IdValueMix, QAfterFilterCondition>
      idLessThanOrEqualTo(
    int? value,
  ) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        LessOrEqualCondition(
          property: 1,
          value: value,
        ),
      );
    });
  }

  QueryBuilder<IdValueMix, IdValueMix, QAfterFilterCondition> idBetween(
    int? lower,
    int? upper,
  ) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        BetweenCondition(
          property: 1,
          lower: lower,
          upper: upper,
        ),
      );
    });
  }

  QueryBuilder<IdValueMix, IdValueMix, QAfterFilterCondition> valueIsNull() {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(const IsNullCondition(property: 2));
    });
  }

  QueryBuilder<IdValueMix, IdValueMix, QAfterFilterCondition> valueIsNotNull() {
    return QueryBuilder.apply(not(), (query) {
      return query.addFilterCondition(const IsNullCondition(property: 2));
    });
  }
}

extension IdValueMixQueryObject
    on QueryBuilder<IdValueMix, IdValueMix, QFilterCondition> {
  QueryBuilder<IdValueMix, IdValueMix, QAfterFilterCondition> value(
      FilterQuery<IdValueColor> q) {
    return QueryBuilder.apply(this, (query) {
      return query.object(q, 2);
    });
  }
}

// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************

IdValueMix _$IdValueMixFromJson(Map<String, dynamic> json) => IdValueMix()
  ..id = (json['id'] as num?)?.toInt()
  ..value = json['value'] == null
      ? null
      : IdValueColor.fromJson(json['value'] as Map<String, dynamic>);

Map<String, dynamic> _$IdValueMixToJson(IdValueMix instance) =>
    <String, dynamic>{
      'id': instance.id,
      'value': instance.value?.toJson(),
    };
