mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
make Query accept wildcard processor: update query executor base classes
This commit is contained in:
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.openapi.application;
|
||||
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
@@ -56,7 +42,7 @@ public abstract class QueryExecutorBase<Result, Params> implements QueryExecutor
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean execute(@NotNull final Params queryParameters, @NotNull final Processor<Result> consumer) {
|
||||
public final boolean execute(@NotNull final Params queryParameters, @NotNull final Processor<? super Result> consumer) {
|
||||
final AtomicBoolean toContinue = new AtomicBoolean(true);
|
||||
final Processor<Result> wrapper = result -> {
|
||||
if (!toContinue.get()) {
|
||||
@@ -97,5 +83,5 @@ public abstract class QueryExecutorBase<Result, Params> implements QueryExecutor
|
||||
/**
|
||||
* Find some results according to queryParameters and feed them to consumer. If consumer returns false, stop.
|
||||
*/
|
||||
public abstract void processQuery(@NotNull Params queryParameters, @NotNull Processor<Result> consumer);
|
||||
public abstract void processQuery(@NotNull Params queryParameters, @NotNull Processor<? super Result> consumer);
|
||||
}
|
||||
|
||||
@@ -1,18 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2009 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.util;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -30,5 +16,5 @@ public interface QueryExecutor<Result, Param> {
|
||||
* Find some results according to queryParameters and feed them to consumer. If consumer returns false, stop.
|
||||
* @return false if the searching should be stopped immediately. This should happen only when consumer has returned false.
|
||||
*/
|
||||
boolean execute(@NotNull Param queryParameters, @NotNull Processor<Result> consumer);
|
||||
boolean execute(@NotNull Param queryParameters, @NotNull Processor<? super Result> consumer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user