TreePrintCondition — implement condition to be compatible with our ContainerUtil

This commit is contained in:
Vladimir Krivosheev
2018-03-12 09:42:59 +01:00
parent c1f2c5c380
commit 2218aa62ae
@@ -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 {