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
29 CheckerExcludes(final String checker) {
30 this.checker = checker;
31 }
32
33 @Nullable
34 @Override
35 public String apply(@Nullable final String input) {
36 String result = null;
37 if (input != null) {
38 final String[] exclude = input.split(":", 2);
39 final String check = exclude[0];
40 final boolean appropriate = "*".equals(check)
41 || this.checker.equals(check);
42 if (appropriate && exclude.length > 1) {
43 result = exclude[1];
44 }
45 }
46 return result;
47 }
48 }