// GENERATED CODE - DO NOT MODIFY BY HAND

part of 'measure_months.dart';

// **************************************************************************
// _IsarCollectionGenerator
// **************************************************************************

// 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

extension GetMeasureMonthsCollection on Isar {
  IsarCollection<int, MeasureMonths> get measureMonths => this.collection();
}

const MeasureMonthsSchema = IsarGeneratedSchema(
  schema: IsarSchema(
    name: 'MeasureMonths',
    idName: 'id',
    embedded: false,
    properties: [
      IsarPropertySchema(
        name: 'name',
        type: IsarType.string,
      ),
      IsarPropertySchema(
        name: 'maintenanceList',
        type: IsarType.boolList,
      ),
      IsarPropertySchema(
        name: 'applyList',
        type: IsarType.boolList,
      ),
    ],
    indexes: [],
  ),
  converter: IsarObjectConverter<int, MeasureMonths>(
    serialize: serializeMeasureMonths,
    deserialize: deserializeMeasureMonths,
    deserializeProperty: deserializeMeasureMonthsProp,
  ),
  embeddedSchemas: [],
);

@isarProtected
int serializeMeasureMonths(IsarWriter writer, MeasureMonths object) {
  {
    final value = object.name;
    if (value == null) {
      IsarCore.writeNull(writer, 1);
    } else {
      IsarCore.writeString(writer, 1, value);
    }
  }
  {
    final list = object.maintenanceList;
    if (list == null) {
      IsarCore.writeNull(writer, 2);
    } else {
      final listWriter = IsarCore.beginList(writer, 2, list.length);
      for (var i = 0; i < list.length; i++) {
        IsarCore.writeBool(listWriter, i, list[i]);
      }
      IsarCore.endList(writer, listWriter);
    }
  }
  {
    final list = object.applyList;
    if (list == null) {
      IsarCore.writeNull(writer, 3);
    } else {
      final listWriter = IsarCore.beginList(writer, 3, list.length);
      for (var i = 0; i < list.length; i++) {
        IsarCore.writeBool(listWriter, i, list[i]);
      }
      IsarCore.endList(writer, listWriter);
    }
  }
  return object.id;
}

@isarProtected
MeasureMonths deserializeMeasureMonths(IsarReader reader) {
  final object = MeasureMonths();
  object.name = IsarCore.readString(reader, 1);
  {
    final length = IsarCore.readList(reader, 2, IsarCore.readerPtrPtr);
    {
      final reader = IsarCore.readerPtr;
      if (reader.isNull) {
        object.maintenanceList = null;
      } else {
        final list = List<bool>.filled(length, false, growable: true);
        for (var i = 0; i < length; i++) {
          list[i] = IsarCore.readBool(reader, i);
        }
        IsarCore.freeReader(reader);
        object.maintenanceList = list;
      }
    }
  }
  {
    final length = IsarCore.readList(reader, 3, IsarCore.readerPtrPtr);
    {
      final reader = IsarCore.readerPtr;
      if (reader.isNull) {
        object.applyList = null;
      } else {
        final list = List<bool>.filled(length, false, growable: true);
        for (var i = 0; i < length; i++) {
          list[i] = IsarCore.readBool(reader, i);
        }
        IsarCore.freeReader(reader);
        object.applyList = list;
      }
    }
  }
  object.id = IsarCore.readId(reader);
  return object;
}

@isarProtected
dynamic deserializeMeasureMonthsProp(IsarReader reader, int property) {
  switch (property) {
    case 1:
      return IsarCore.readString(reader, 1);
    case 2:
      {
        final length = IsarCore.readList(reader, 2, IsarCore.readerPtrPtr);
        {
          final reader = IsarCore.readerPtr;
          if (reader.isNull) {
            return null;
          } else {
            final list = List<bool>.filled(length, false, growable: true);
            for (var i = 0; i < length; i++) {
              list[i] = IsarCore.readBool(reader, i);
            }
            IsarCore.freeReader(reader);
            return list;
          }
        }
      }
    case 3:
      {
        final length = IsarCore.readList(reader, 3, IsarCore.readerPtrPtr);
        {
          final reader = IsarCore.readerPtr;
          if (reader.isNull) {
            return null;
          } else {
            final list = List<bool>.filled(length, false, growable: true);
            for (var i = 0; i < length; i++) {
              list[i] = IsarCore.readBool(reader, i);
            }
            IsarCore.freeReader(reader);
            return list;
          }
        }
      }
    case 0:
      return IsarCore.readId(reader);
    default:
      throw ArgumentError('Unknown property: $property');
  }
}

sealed class _MeasureMonthsUpdate {
  bool call({
    required int id,
    String? name,
  });
}

class _MeasureMonthsUpdateImpl implements _MeasureMonthsUpdate {
  const _MeasureMonthsUpdateImpl(this.collection);

  final IsarCollection<int, MeasureMonths> collection;

  @override
  bool call({
    required int id,
    Object? name = ignore,
  }) {
    return collection.updateProperties([
          id
        ], {
          if (name != ignore) 1: name as String?,
        }) >
        0;
  }
}

sealed class _MeasureMonthsUpdateAll {
  int call({
    required List<int> id,
    String? name,
  });
}

class _MeasureMonthsUpdateAllImpl implements _MeasureMonthsUpdateAll {
  const _MeasureMonthsUpdateAllImpl(this.collection);

  final IsarCollection<int, MeasureMonths> collection;

  @override
  int call({
    required List<int> id,
    Object? name = ignore,
  }) {
    return collection.updateProperties(id, {
      if (name != ignore) 1: name as String?,
    });
  }
}

extension MeasureMonthsUpdate on IsarCollection<int, MeasureMonths> {
  _MeasureMonthsUpdate get update => _MeasureMonthsUpdateImpl(this);

  _MeasureMonthsUpdateAll get updateAll => _MeasureMonthsUpdateAllImpl(this);
}

sealed class _MeasureMonthsQueryUpdate {
  int call({
    String? name,
  });
}

class _MeasureMonthsQueryUpdateImpl implements _MeasureMonthsQueryUpdate {
  const _MeasureMonthsQueryUpdateImpl(this.query, {this.limit});

  final IsarQuery<MeasureMonths> query;
  final int? limit;

  @override
  int call({
    Object? name = ignore,
  }) {
    return query.updateProperties(limit: limit, {
      if (name != ignore) 1: name as String?,
    });
  }
}

extension MeasureMonthsQueryUpdate on IsarQuery<MeasureMonths> {
  _MeasureMonthsQueryUpdate get updateFirst =>
      _MeasureMonthsQueryUpdateImpl(this, limit: 1);

  _MeasureMonthsQueryUpdate get updateAll =>
      _MeasureMonthsQueryUpdateImpl(this);
}

class _MeasureMonthsQueryBuilderUpdateImpl
    implements _MeasureMonthsQueryUpdate {
  const _MeasureMonthsQueryBuilderUpdateImpl(this.query, {this.limit});

  final QueryBuilder<MeasureMonths, MeasureMonths, QOperations> query;
  final int? limit;

  @override
  int call({
    Object? name = ignore,
  }) {
    final q = query.build();
    try {
      return q.updateProperties(limit: limit, {
        if (name != ignore) 1: name as String?,
      });
    } finally {
      q.close();
    }
  }
}

extension MeasureMonthsQueryBuilderUpdate
    on QueryBuilder<MeasureMonths, MeasureMonths, QOperations> {
  _MeasureMonthsQueryUpdate get updateFirst =>
      _MeasureMonthsQueryBuilderUpdateImpl(this, limit: 1);

  _MeasureMonthsQueryUpdate get updateAll =>
      _MeasureMonthsQueryBuilderUpdateImpl(this);
}

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

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

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition> nameEqualTo(
    String? value, {
    bool caseSensitive = true,
  }) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        EqualCondition(
          property: 1,
          value: value,
          caseSensitive: caseSensitive,
        ),
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      nameGreaterThan(
    String? value, {
    bool caseSensitive = true,
  }) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        GreaterCondition(
          property: 1,
          value: value,
          caseSensitive: caseSensitive,
        ),
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      nameGreaterThanOrEqualTo(
    String? value, {
    bool caseSensitive = true,
  }) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        GreaterOrEqualCondition(
          property: 1,
          value: value,
          caseSensitive: caseSensitive,
        ),
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      nameLessThan(
    String? value, {
    bool caseSensitive = true,
  }) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        LessCondition(
          property: 1,
          value: value,
          caseSensitive: caseSensitive,
        ),
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      nameLessThanOrEqualTo(
    String? value, {
    bool caseSensitive = true,
  }) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        LessOrEqualCondition(
          property: 1,
          value: value,
          caseSensitive: caseSensitive,
        ),
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition> nameBetween(
    String? lower,
    String? upper, {
    bool caseSensitive = true,
  }) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        BetweenCondition(
          property: 1,
          lower: lower,
          upper: upper,
          caseSensitive: caseSensitive,
        ),
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      nameStartsWith(
    String value, {
    bool caseSensitive = true,
  }) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        StartsWithCondition(
          property: 1,
          value: value,
          caseSensitive: caseSensitive,
        ),
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      nameEndsWith(
    String value, {
    bool caseSensitive = true,
  }) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        EndsWithCondition(
          property: 1,
          value: value,
          caseSensitive: caseSensitive,
        ),
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      nameContains(String value, {bool caseSensitive = true}) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        ContainsCondition(
          property: 1,
          value: value,
          caseSensitive: caseSensitive,
        ),
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition> nameMatches(
      String pattern,
      {bool caseSensitive = true}) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        MatchesCondition(
          property: 1,
          wildcard: pattern,
          caseSensitive: caseSensitive,
        ),
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      nameIsEmpty() {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        const EqualCondition(
          property: 1,
          value: '',
        ),
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      nameIsNotEmpty() {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        const GreaterCondition(
          property: 1,
          value: '',
        ),
      );
    });
  }

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

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

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      maintenanceListElementEqualTo(
    bool value,
  ) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        EqualCondition(
          property: 2,
          value: value,
        ),
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      maintenanceListIsEmpty() {
    return not().group(
      (q) => q.maintenanceListIsNull().or().maintenanceListIsNotEmpty(),
    );
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      maintenanceListIsNotEmpty() {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        const GreaterOrEqualCondition(property: 2, value: null),
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      applyListIsNull() {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(const IsNullCondition(property: 3));
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      applyListIsNotNull() {
    return QueryBuilder.apply(not(), (query) {
      return query.addFilterCondition(const IsNullCondition(property: 3));
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      applyListElementEqualTo(
    bool value,
  ) {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        EqualCondition(
          property: 3,
          value: value,
        ),
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      applyListIsEmpty() {
    return not().group(
      (q) => q.applyListIsNull().or().applyListIsNotEmpty(),
    );
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterFilterCondition>
      applyListIsNotEmpty() {
    return QueryBuilder.apply(this, (query) {
      return query.addFilterCondition(
        const GreaterOrEqualCondition(property: 3, value: null),
      );
    });
  }

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

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

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

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

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

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

extension MeasureMonthsQueryObject
    on QueryBuilder<MeasureMonths, MeasureMonths, QFilterCondition> {}

extension MeasureMonthsQuerySortBy
    on QueryBuilder<MeasureMonths, MeasureMonths, QSortBy> {
  QueryBuilder<MeasureMonths, MeasureMonths, QAfterSortBy> sortByName(
      {bool caseSensitive = true}) {
    return QueryBuilder.apply(this, (query) {
      return query.addSortBy(
        1,
        caseSensitive: caseSensitive,
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterSortBy> sortByNameDesc(
      {bool caseSensitive = true}) {
    return QueryBuilder.apply(this, (query) {
      return query.addSortBy(
        1,
        sort: Sort.desc,
        caseSensitive: caseSensitive,
      );
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterSortBy> sortById() {
    return QueryBuilder.apply(this, (query) {
      return query.addSortBy(0);
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterSortBy> sortByIdDesc() {
    return QueryBuilder.apply(this, (query) {
      return query.addSortBy(0, sort: Sort.desc);
    });
  }
}

extension MeasureMonthsQuerySortThenBy
    on QueryBuilder<MeasureMonths, MeasureMonths, QSortThenBy> {
  QueryBuilder<MeasureMonths, MeasureMonths, QAfterSortBy> thenByName(
      {bool caseSensitive = true}) {
    return QueryBuilder.apply(this, (query) {
      return query.addSortBy(1, caseSensitive: caseSensitive);
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterSortBy> thenByNameDesc(
      {bool caseSensitive = true}) {
    return QueryBuilder.apply(this, (query) {
      return query.addSortBy(1, sort: Sort.desc, caseSensitive: caseSensitive);
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterSortBy> thenById() {
    return QueryBuilder.apply(this, (query) {
      return query.addSortBy(0);
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterSortBy> thenByIdDesc() {
    return QueryBuilder.apply(this, (query) {
      return query.addSortBy(0, sort: Sort.desc);
    });
  }
}

extension MeasureMonthsQueryWhereDistinct
    on QueryBuilder<MeasureMonths, MeasureMonths, QDistinct> {
  QueryBuilder<MeasureMonths, MeasureMonths, QAfterDistinct> distinctByName(
      {bool caseSensitive = true}) {
    return QueryBuilder.apply(this, (query) {
      return query.addDistinctBy(1, caseSensitive: caseSensitive);
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterDistinct>
      distinctByMaintenanceList() {
    return QueryBuilder.apply(this, (query) {
      return query.addDistinctBy(2);
    });
  }

  QueryBuilder<MeasureMonths, MeasureMonths, QAfterDistinct>
      distinctByApplyList() {
    return QueryBuilder.apply(this, (query) {
      return query.addDistinctBy(3);
    });
  }
}

extension MeasureMonthsQueryProperty1
    on QueryBuilder<MeasureMonths, MeasureMonths, QProperty> {
  QueryBuilder<MeasureMonths, String?, QAfterProperty> nameProperty() {
    return QueryBuilder.apply(this, (query) {
      return query.addProperty(1);
    });
  }

  QueryBuilder<MeasureMonths, List<bool>?, QAfterProperty>
      maintenanceListProperty() {
    return QueryBuilder.apply(this, (query) {
      return query.addProperty(2);
    });
  }

  QueryBuilder<MeasureMonths, List<bool>?, QAfterProperty> applyListProperty() {
    return QueryBuilder.apply(this, (query) {
      return query.addProperty(3);
    });
  }

  QueryBuilder<MeasureMonths, int, QAfterProperty> idProperty() {
    return QueryBuilder.apply(this, (query) {
      return query.addProperty(0);
    });
  }
}

extension MeasureMonthsQueryProperty2<R>
    on QueryBuilder<MeasureMonths, R, QAfterProperty> {
  QueryBuilder<MeasureMonths, (R, String?), QAfterProperty> nameProperty() {
    return QueryBuilder.apply(this, (query) {
      return query.addProperty(1);
    });
  }

  QueryBuilder<MeasureMonths, (R, List<bool>?), QAfterProperty>
      maintenanceListProperty() {
    return QueryBuilder.apply(this, (query) {
      return query.addProperty(2);
    });
  }

  QueryBuilder<MeasureMonths, (R, List<bool>?), QAfterProperty>
      applyListProperty() {
    return QueryBuilder.apply(this, (query) {
      return query.addProperty(3);
    });
  }

  QueryBuilder<MeasureMonths, (R, int), QAfterProperty> idProperty() {
    return QueryBuilder.apply(this, (query) {
      return query.addProperty(0);
    });
  }
}

extension MeasureMonthsQueryProperty3<R1, R2>
    on QueryBuilder<MeasureMonths, (R1, R2), QAfterProperty> {
  QueryBuilder<MeasureMonths, (R1, R2, String?), QOperations> nameProperty() {
    return QueryBuilder.apply(this, (query) {
      return query.addProperty(1);
    });
  }

  QueryBuilder<MeasureMonths, (R1, R2, List<bool>?), QOperations>
      maintenanceListProperty() {
    return QueryBuilder.apply(this, (query) {
      return query.addProperty(2);
    });
  }

  QueryBuilder<MeasureMonths, (R1, R2, List<bool>?), QOperations>
      applyListProperty() {
    return QueryBuilder.apply(this, (query) {
      return query.addProperty(3);
    });
  }

  QueryBuilder<MeasureMonths, (R1, R2, int), QOperations> idProperty() {
    return QueryBuilder.apply(this, (query) {
      return query.addProperty(0);
    });
  }
}

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

MeasureMonths _$MeasureMonthsFromJson(Map<String, dynamic> json) =>
    MeasureMonths()
      ..id = (json['id'] as num).toInt()
      ..name = json['name'] as String?
      ..maintenanceList = (json['maintenanceList'] as List<dynamic>?)
          ?.map((e) => e as bool)
          .toList()
      ..applyList =
          (json['applyList'] as List<dynamic>?)?.map((e) => e as bool).toList();

Map<String, dynamic> _$MeasureMonthsToJson(MeasureMonths instance) =>
    <String, dynamic>{
      'id': instance.id,
      'name': instance.name,
      'maintenanceList': instance.maintenanceList,
      'applyList': instance.applyList,
    };
