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