1 package com.atlassian.sal.api.features;
2
3 import com.google.common.base.Predicate;
4
5 import javax.annotation.Nullable;
6
7
8
9
10 public class FeatureKeyScopePredicate implements Predicate<FeatureKeyScope> {
11 private final FeatureKeyScope featureKeyScope;
12
13 public FeatureKeyScopePredicate(final FeatureKeyScope featureKeyScope) {
14 this.featureKeyScope = featureKeyScope;
15 }
16
17 public static FeatureKeyScopePredicate filterBy(final FeatureKeyScope featureKeyScope) {
18 return new FeatureKeyScopePredicate(featureKeyScope);
19 }
20
21 @Override
22 public boolean apply(@Nullable final FeatureKeyScope input) {
23 return input != null && input == featureKeyScope;
24 }
25 }