1 | |
package org.kuali.rice.core.api.mo; |
2 | |
|
3 | |
import org.apache.commons.lang.builder.EqualsBuilder; |
4 | |
import org.apache.commons.lang.builder.HashCodeBuilder; |
5 | |
import org.apache.commons.lang.builder.ToStringBuilder; |
6 | |
import org.kuali.rice.core.api.CoreConstants; |
7 | |
import org.kuali.rice.core.api.util.CollectionUtils; |
8 | |
|
9 | |
import javax.xml.bind.Unmarshaller; |
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
|
21 | |
|
22 | |
|
23 | |
public abstract class AbstractDataTransferObject implements ModelObjectComplete { |
24 | |
|
25 | |
protected AbstractDataTransferObject() { |
26 | 488 | super(); |
27 | 488 | } |
28 | |
|
29 | |
@Override |
30 | |
public int hashCode() { |
31 | 408 | return HashCodeBuilder.reflectionHashCode(this, Constants.HASH_CODE_EQUALS_EXCLUDE); |
32 | |
} |
33 | |
|
34 | |
@Override |
35 | |
public boolean equals(Object obj) { |
36 | 151 | return EqualsBuilder.reflectionEquals(obj, this, Constants.HASH_CODE_EQUALS_EXCLUDE); |
37 | |
} |
38 | |
|
39 | |
@Override |
40 | |
public String toString() { |
41 | 1 | return ToStringBuilder.reflectionToString(this); |
42 | |
} |
43 | |
|
44 | |
@SuppressWarnings("unused") |
45 | |
protected void beforeUnmarshal(Unmarshaller u, Object parent) throws Exception { |
46 | 173 | } |
47 | |
|
48 | |
@SuppressWarnings("unused") |
49 | |
protected void afterUnmarshal(Unmarshaller u, Object parent) throws Exception { |
50 | 173 | CollectionUtils.makeUnmodifiableAndNullSafe(this); |
51 | 173 | } |
52 | |
|
53 | |
|
54 | |
|
55 | |
|
56 | 0 | protected static class Constants { |
57 | 1 | final static String[] HASH_CODE_EQUALS_EXCLUDE = {CoreConstants.CommonElements.FUTURE_ELEMENTS}; |
58 | |
} |
59 | |
} |