1
2
3
4
5 package com.qulice.maven;
6
7 import com.google.common.base.Function;
8 import javax.annotation.Nullable;
9
10
11
12
13
14
15
16
17 final class CheckerExcludes implements Function<String, String> {
18
19
20
21
22 private final String checker;
23
24
25
26
27
28 CheckerExcludes(final String checker) {
29 this.checker = checker;
30 }
31
32 @Nullable
33 @Override
34 public String apply(@Nullable final String input) {
35 String result = null;
36 if (input != null) {
37 final String[] exclude = input.split(":", 2);
38 final String check = exclude[0];
39 final boolean appropriate = "*".equals(check)
40 || this.checker.equals(check);
41 if (appropriate && exclude.length > 1) {
42 result = exclude[1];
43 }
44 }
45 return result;
46 }
47 }