inConditionValues method

bool inConditionValues(
  1. Object? value1,
  2. List value2, {
  3. Object? parameters,
  4. List? positionalParameters,
  5. Map<String, Object?>? namedParameters,
  6. EntityHandler? entityHandler,
})

Implementation

bool inConditionValues(Object? value1, List value2,
    {Object? parameters,
    List? positionalParameters,
    Map<String, Object?>? namedParameters,
    EntityHandler? entityHandler}) {
  if (value1 is ConditionParameter) {
    return value1.matchesIn(value2,
        parameters: parameters,
        positionalParameters: positionalParameters,
        namedParameters: namedParameters,
        entityHandler: entityHandler);
  } else if (value1 is List) {
    for (var v2 in value2) {
      if (v2 is ConditionParameter) {
        var match = v2.matchesIn(value1,
            parameters: parameters,
            positionalParameters: positionalParameters,
            namedParameters: namedParameters,
            entityHandler: entityHandler);
        if (match) return true;
      } else {
        for (var v1 in value1) {
          var match = EntityHandler.equalsValuesBasic(v1, v2,
              entityHandler: entityHandler);
          if (match) return true;
        }
      }
    }

    return false;
  } else {
    for (var v2 in value2) {
      if (v2 is ConditionParameter) {
        var match = v2.matches(value1,
            parameters: parameters,
            positionalParameters: positionalParameters,
            namedParameters: namedParameters,
            entityHandler: entityHandler);
        if (match) return true;
      } else {
        var match = EntityHandler.equalsValuesBasic(value1, v2,
            entityHandler: entityHandler);
        if (match) return true;
      }
    }

    return false;
  }
}