1 package net.sourceforge.basher.events;
2
3 import net.sourceforge.basher.BasherContext;
4
5
6
7
8
9 public abstract class CollectionEvent extends BasherEvent
10 {
11 private BasherContext _basherContext;
12
13 protected CollectionEvent(final BasherContext basherContext)
14 {
15 _basherContext = basherContext;
16 }
17
18 public BasherContext getBasherContext()
19 {
20 return _basherContext;
21 }
22
23 @Override
24 public String toString()
25 {
26 return "CollectionEvent{" +
27 "_basherContext=" + _basherContext +
28 "} " + super.toString();
29 }
30
31 @Override
32 public boolean equals(final Object o)
33 {
34 if (this == o)
35 {
36 return true;
37 }
38 if (o == null || getClass() != o.getClass())
39 {
40 return false;
41 }
42 if (!super.equals(o))
43 {
44 return false;
45 }
46
47 final CollectionEvent that = (CollectionEvent) o;
48
49 if (_basherContext != null ? !_basherContext.equals(that._basherContext) : that._basherContext != null)
50 {
51 return false;
52 }
53
54 return true;
55 }
56
57 @Override
58 public int hashCode()
59 {
60 int result = super.hashCode();
61 result = 31 * result + (_basherContext != null ? _basherContext.hashCode() : 0);
62 return result;
63 }
64 }