mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
TreePrintCondition — implement condition to be compatible with our ContainerUtil
This commit is contained in:
@@ -1,19 +1,25 @@
|
||||
// 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.testFramework;
|
||||
|
||||
import com.intellij.openapi.util.Condition;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.function.Predicate;
|
||||
|
||||
public abstract class TreePrintCondition implements Predicate<String> {
|
||||
public abstract class TreePrintCondition implements Predicate<String>, Condition<String> {
|
||||
public abstract static class SetBased extends TreePrintCondition {
|
||||
protected Set<String> mySet = new HashSet<>();
|
||||
|
||||
public SetBased(String... elements) {
|
||||
ContainerUtil.addAll(mySet, elements);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean value(String s) {
|
||||
return test(s);
|
||||
}
|
||||
}
|
||||
|
||||
public static class Include extends SetBased {
|
||||
|
||||
Reference in New Issue
Block a user