1 | package gov.hhs.fha.nhinc.subscription.repository.data;
|
---|
2 |
|
---|
3 | import java.io.Serializable;
|
---|
4 |
|
---|
5 | /**
|
---|
6 | * Storage object for a subscription record
|
---|
7 | *
|
---|
8 | * @author Neil Webb
|
---|
9 | */
|
---|
10 | public class SubscriptionRecord implements Serializable
|
---|
11 | {
|
---|
12 | private static final long serialVersionUID = 2604328369853548393L;
|
---|
13 | private Long subscriptionId;
|
---|
14 | private SubscriptionType type;
|
---|
15 | private SubscriptionItem subscription;
|
---|
16 |
|
---|
17 | public SubscriptionItem getSubscription()
|
---|
18 | {
|
---|
19 | return subscription;
|
---|
20 | }
|
---|
21 |
|
---|
22 | public void setSubscription(SubscriptionItem subscription)
|
---|
23 | {
|
---|
24 | this.subscription = subscription;
|
---|
25 | }
|
---|
26 |
|
---|
27 | public Long getSubscriptionId()
|
---|
28 | {
|
---|
29 | return subscriptionId;
|
---|
30 | }
|
---|
31 |
|
---|
32 | public void setSubscriptionId(Long subscriptionId)
|
---|
33 | {
|
---|
34 | this.subscriptionId = subscriptionId;
|
---|
35 | }
|
---|
36 |
|
---|
37 | public SubscriptionType getType()
|
---|
38 | {
|
---|
39 | return type;
|
---|
40 | }
|
---|
41 |
|
---|
42 | public void setType(SubscriptionType type)
|
---|
43 | {
|
---|
44 | this.type = type;
|
---|
45 | }
|
---|
46 |
|
---|
47 | @Override
|
---|
48 | public boolean equals(Object obj)
|
---|
49 | {
|
---|
50 | if (obj == null)
|
---|
51 | {
|
---|
52 | return false;
|
---|
53 | }
|
---|
54 | if (getClass() != obj.getClass())
|
---|
55 | {
|
---|
56 | return false;
|
---|
57 | }
|
---|
58 | final SubscriptionRecord other = (SubscriptionRecord) obj;
|
---|
59 | if (this.subscriptionId != other.subscriptionId && (this.subscriptionId == null || !this.subscriptionId.equals(other.subscriptionId)))
|
---|
60 | {
|
---|
61 | return false;
|
---|
62 | }
|
---|
63 | if (this.type != other.type)
|
---|
64 | {
|
---|
65 | return false;
|
---|
66 | }
|
---|
67 | if (this.subscription != other.subscription && (this.subscription == null || !this.subscription.equals(other.subscription)))
|
---|
68 | {
|
---|
69 | return false;
|
---|
70 | }
|
---|
71 | return true;
|
---|
72 | }
|
---|
73 |
|
---|
74 | @Override
|
---|
75 | public int hashCode()
|
---|
76 | {
|
---|
77 | int hash = 7;
|
---|
78 | hash = 97 * hash + (this.subscriptionId != null ? this.subscriptionId.hashCode() : 0);
|
---|
79 | hash = 97 * hash + (this.type != null ? this.type.hashCode() : 0);
|
---|
80 | hash = 97 * hash + (this.subscription != null ? this.subscription.hashCode() : 0);
|
---|
81 | return hash;
|
---|
82 | }
|
---|
83 |
|
---|
84 |
|
---|
85 | }
|
---|