Last change
on this file since 52 was
38,
checked in by stoda, 11 years ago
|
Remote exception added
todo: change throws Exception to Throwable since it seems that NoSuchMethodException? does not inherit from Exception...
|
File size:
482 bytes
|
Line | |
---|
1 | package exceptionTest; |
---|
2 | |
---|
3 | import java.io.Serializable; |
---|
4 | |
---|
5 | public class Trailer implements Serializable { |
---|
6 | |
---|
7 | /** |
---|
8 | * |
---|
9 | */ |
---|
10 | private static final long serialVersionUID = 1L; |
---|
11 | |
---|
12 | private int kg; |
---|
13 | |
---|
14 | public Trailer(int kg) { |
---|
15 | this.kg = kg; |
---|
16 | } |
---|
17 | |
---|
18 | public int getKg() { |
---|
19 | return kg; |
---|
20 | } |
---|
21 | |
---|
22 | public void setKg(int kg) { |
---|
23 | this.kg = kg; |
---|
24 | } |
---|
25 | |
---|
26 | @Override |
---|
27 | public boolean equals(Object obj) { |
---|
28 | if (obj instanceof Trailer) { |
---|
29 | Trailer t = (Trailer) obj; |
---|
30 | return kg == t.getKg(); |
---|
31 | } |
---|
32 | return false; |
---|
33 | } |
---|
34 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.