blob: d1744aa607b03e1d4bf10503d4bd517350cd6841 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import java.util.regex.Pattern;
@lombok.Setter @lombok.Getter
class Tolerate {
private Pattern pattern;
@lombok.experimental.Tolerate public void setPattern(String pattern) {
setPattern(Pattern.compile(pattern));
}
}
@lombok.Getter @lombok.experimental.Wither @lombok.AllArgsConstructor
class Tolerate2 {
private final Pattern pattern;
@lombok.experimental.Tolerate public Tolerate2 withPattern(String pattern) {
return withPattern(Pattern.compile(pattern));
}
public Tolerate2 withPattern(String nameGlob, String extensionGlob) {
return withPattern(nameGlob.replace("*", ".*") + "\\." + extensionGlob.replace("*", ".*"));
}
}
|