e9fe014485dcb3d9f8723703725264f5b9146d53
[jalview.git] / src / jalview / util / matcher / KeyedMatcherI.java
1 package jalview.util.matcher;
2
3 import java.util.function.Function;
4
5 /**
6  * An interface for an object that can apply one or more match conditions, given
7  * a key-value provider. The match conditions are stored against key values, and
8  * applied to the value obtained by a key-value lookup.
9  * 
10  * @author gmcarstairs
11  */
12 public interface KeyedMatcherI
13 {
14   /**
15    * Answers true if the value provided for this matcher's key passes this
16    * matcher's match condition
17    * 
18    * @param valueProvider
19    * @return
20    */
21   boolean matches(Function<String, String> valueProvider);
22
23   /**
24    * Answers the value key this matcher operates on
25    * 
26    * @return
27    */
28   String getKey();
29
30   /**
31    * Answers the match condition that is applied
32    * 
33    * @return
34    */
35   MatcherI getMatcher();
36 }