1
2
3
4
5
6
7
8
9
10 package org.eclipse.jgit.ignore.internal;
11
12 import org.eclipse.jgit.ignore.IMatcher;
13
14
15
16
17
18
19 public abstract class AbstractMatcher implements IMatcher {
20
21 final boolean dirOnly;
22
23 final String pattern;
24
25
26
27
28
29
30
31 AbstractMatcher(String pattern, boolean dirOnly) {
32 this.pattern = pattern;
33 this.dirOnly = dirOnly;
34 }
35
36
37 @Override
38 public String toString() {
39 return pattern;
40 }
41
42
43 @Override
44 public int hashCode() {
45 return pattern.hashCode();
46 }
47
48
49 @Override
50 public boolean equals(Object obj) {
51 if (this == obj)
52 return true;
53 if (!(obj instanceof AbstractMatcher))
54 return false;
55 AbstractMatcher other = (AbstractMatcher) obj;
56 return dirOnly == other.dirOnly && pattern.equals(other.pattern);
57 }
58 }