1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.transport.xmpp.filters; |
12 | |
|
13 | |
import org.mule.util.ClassUtils; |
14 | |
|
15 | |
import org.jivesoftware.smack.filter.PacketFilter; |
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
public class XmppFromContainsFilter extends AbstractXmppFilter |
21 | |
{ |
22 | |
protected volatile String pattern; |
23 | |
|
24 | |
public XmppFromContainsFilter() |
25 | |
{ |
26 | 0 | super(); |
27 | 0 | } |
28 | |
|
29 | |
public XmppFromContainsFilter(String pattern) |
30 | 0 | { |
31 | 0 | this.pattern = pattern; |
32 | 0 | } |
33 | |
|
34 | |
public String getPattern() |
35 | |
{ |
36 | 0 | return pattern; |
37 | |
} |
38 | |
|
39 | |
public void setPattern(String pattern) |
40 | |
{ |
41 | 0 | this.pattern = pattern; |
42 | 0 | } |
43 | |
|
44 | |
@Override |
45 | |
protected PacketFilter createFilter() |
46 | |
{ |
47 | 0 | return new XmppFromContainsFilter(pattern); |
48 | |
} |
49 | |
|
50 | |
@Override |
51 | |
public boolean equals(Object obj) |
52 | |
{ |
53 | 0 | if (this == obj) return true; |
54 | 0 | if (obj == null || getClass() != obj.getClass()) return false; |
55 | |
|
56 | 0 | final XmppFromContainsFilter other = (XmppFromContainsFilter) obj; |
57 | 0 | return ClassUtils.equal(pattern, other.pattern); |
58 | |
} |
59 | |
|
60 | |
@Override |
61 | |
public int hashCode() |
62 | |
{ |
63 | 0 | return ClassUtils.hash(new Object[]{ getClass(), pattern }); |
64 | |
} |
65 | |
} |