1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.util.queue; |
12 | |
|
13 | |
public class QueueConfiguration |
14 | |
{ |
15 | |
|
16 | |
protected int capacity; |
17 | |
protected boolean persistent; |
18 | |
|
19 | |
public QueueConfiguration(int capacity, boolean persistent) |
20 | 0 | { |
21 | 0 | this.capacity = capacity; |
22 | 0 | this.persistent = persistent; |
23 | 0 | } |
24 | |
|
25 | |
public QueueConfiguration(int capacity) |
26 | |
{ |
27 | 0 | this(capacity, false); |
28 | 0 | } |
29 | |
|
30 | |
public QueueConfiguration(boolean persistent) |
31 | |
{ |
32 | 0 | this(0, persistent); |
33 | 0 | } |
34 | |
|
35 | |
public QueueConfiguration() |
36 | |
{ |
37 | 0 | this(0, false); |
38 | 0 | } |
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
public int getCapacity() |
44 | |
{ |
45 | 0 | return capacity; |
46 | |
} |
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
public void setCapacity(int capacity) |
52 | |
{ |
53 | 0 | this.capacity = capacity; |
54 | 0 | } |
55 | |
|
56 | |
|
57 | |
|
58 | |
|
59 | |
public boolean isPersistent() |
60 | |
{ |
61 | 0 | return persistent; |
62 | |
} |
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
public void setPersistent(boolean persistent) |
68 | |
{ |
69 | 0 | this.persistent = persistent; |
70 | 0 | } |
71 | |
|
72 | |
@Override |
73 | |
public int hashCode() |
74 | |
{ |
75 | 0 | final int prime = 31; |
76 | 0 | int result = 1; |
77 | 0 | result = prime * result + capacity; |
78 | 0 | result = prime * result + (persistent ? 1231 : 1237); |
79 | 0 | return result; |
80 | |
} |
81 | |
|
82 | |
@Override |
83 | |
public boolean equals(Object obj) |
84 | |
{ |
85 | 0 | if (this == obj) |
86 | |
{ |
87 | 0 | return true; |
88 | |
} |
89 | 0 | if (obj == null) |
90 | |
{ |
91 | 0 | return false; |
92 | |
} |
93 | 0 | if (getClass() != obj.getClass()) |
94 | |
{ |
95 | 0 | return false; |
96 | |
} |
97 | 0 | QueueConfiguration other = (QueueConfiguration) obj; |
98 | 0 | if (capacity != other.capacity) |
99 | |
{ |
100 | 0 | return false; |
101 | |
} |
102 | 0 | if (persistent != other.persistent) |
103 | |
{ |
104 | 0 | return false; |
105 | |
} |
106 | 0 | return true; |
107 | |
} |
108 | |
|
109 | |
} |