1 | |
package org.kuali.rice.kim.api.entity.type; |
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.mo.ModelObjectComplete; |
8 | |
import org.kuali.rice.kim.api.entity.address.EntityAddress; |
9 | |
import org.kuali.rice.kim.api.entity.address.EntityAddressContract; |
10 | |
import org.kuali.rice.kim.api.entity.email.EntityEmail; |
11 | |
import org.kuali.rice.kim.api.entity.phone.EntityPhone; |
12 | |
import org.kuali.rice.kim.api.entity.phone.EntityPhoneContract; |
13 | |
import org.w3c.dom.Element; |
14 | |
|
15 | |
import javax.xml.bind.annotation.XmlAccessType; |
16 | |
import javax.xml.bind.annotation.XmlAccessorType; |
17 | |
import javax.xml.bind.annotation.XmlAnyElement; |
18 | |
import javax.xml.bind.annotation.XmlElement; |
19 | |
import javax.xml.bind.annotation.XmlRootElement; |
20 | |
import javax.xml.bind.annotation.XmlType; |
21 | |
import java.util.Collection; |
22 | |
|
23 | |
@XmlRootElement(name = EntityTypeDataDefault.Constants.ROOT_ELEMENT_NAME) |
24 | |
@XmlAccessorType(XmlAccessType.NONE) |
25 | |
@XmlType(name = EntityTypeDataDefault.Constants.TYPE_NAME, propOrder = { |
26 | |
EntityTypeDataDefault.Elements.ENTITY_TYPE_CODE, |
27 | |
EntityTypeDataDefault.Elements.DEFAULT_ADDRESS, |
28 | |
EntityTypeDataDefault.Elements.DEFAULT_EMAIL_ADDRESS, |
29 | |
EntityTypeDataDefault.Elements.DEFAULT_PHONE_NUMBER, |
30 | |
|
31 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS |
32 | |
}) |
33 | |
public final class EntityTypeDataDefault |
34 | |
{ |
35 | |
@XmlElement(name = Elements.ENTITY_TYPE_CODE, required = true) |
36 | |
private final String entityTypeCode; |
37 | |
@XmlElement(name = Elements.DEFAULT_ADDRESS, required = false) |
38 | |
private final EntityAddress defaultAddress; |
39 | |
@XmlElement(name = Elements.DEFAULT_EMAIL_ADDRESS, required = false) |
40 | |
private final EntityEmail defaultEmailAddress; |
41 | |
@XmlElement(name = Elements.DEFAULT_PHONE_NUMBER, required = false) |
42 | |
private final EntityPhone defaultPhoneNumber; |
43 | 0 | @SuppressWarnings("unused") |
44 | |
@XmlAnyElement |
45 | |
private final Collection<Element> _futureElements = null; |
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | 0 | private EntityTypeDataDefault() { |
51 | 0 | this.entityTypeCode = null; |
52 | 0 | this.defaultAddress = null; |
53 | 0 | this.defaultEmailAddress = null; |
54 | 0 | this.defaultPhoneNumber = null; |
55 | |
|
56 | 0 | } |
57 | |
|
58 | 0 | public EntityTypeDataDefault(String entityTypeCode, EntityAddress defaultAddress, EntityEmail defaultEmailAddress, EntityPhone defaultPhoneNumber) { |
59 | 0 | this.entityTypeCode = entityTypeCode; |
60 | 0 | this.defaultAddress = defaultAddress; |
61 | 0 | this.defaultEmailAddress = defaultEmailAddress; |
62 | 0 | this.defaultPhoneNumber = defaultPhoneNumber; |
63 | 0 | } |
64 | |
|
65 | |
public String getEntityTypeCode() { |
66 | 0 | return this.entityTypeCode; |
67 | |
} |
68 | |
public EntityAddressContract getDefaultAddress() { |
69 | 0 | return this.defaultAddress; |
70 | |
} |
71 | |
|
72 | |
public EntityEmail getDefaultEmailAddress() { |
73 | 0 | return this.defaultEmailAddress; |
74 | |
} |
75 | |
|
76 | |
public EntityPhoneContract getDefaultPhoneNumber() { |
77 | 0 | return this.defaultPhoneNumber; |
78 | |
} |
79 | |
|
80 | |
@Override |
81 | |
public int hashCode() { |
82 | 0 | return HashCodeBuilder.reflectionHashCode(this, Constants.HASH_CODE_EQUALS_EXCLUDE); |
83 | |
} |
84 | |
|
85 | |
@Override |
86 | |
public boolean equals(Object object) { |
87 | 0 | return EqualsBuilder.reflectionEquals(object, this, Constants.HASH_CODE_EQUALS_EXCLUDE); |
88 | |
} |
89 | |
|
90 | |
@Override |
91 | |
public String toString() { |
92 | 0 | return ToStringBuilder.reflectionToString(this); |
93 | |
} |
94 | |
|
95 | |
|
96 | |
|
97 | |
|
98 | |
|
99 | |
|
100 | |
|
101 | |
|
102 | |
|
103 | 0 | static class Constants { |
104 | |
|
105 | |
final static String ROOT_ELEMENT_NAME = "entityTypeDataDefault"; |
106 | |
final static String TYPE_NAME = "EntityTypeDataDefaultType"; |
107 | 0 | final static String[] HASH_CODE_EQUALS_EXCLUDE = new String[] {CoreConstants.CommonElements.FUTURE_ELEMENTS }; |
108 | |
|
109 | |
} |
110 | |
|
111 | |
|
112 | |
|
113 | |
|
114 | |
|
115 | |
|
116 | 0 | static class Elements { |
117 | |
final static String ENTITY_TYPE_CODE = "entityTypeCode"; |
118 | |
final static String DEFAULT_ADDRESS = "defaultAddress"; |
119 | |
final static String DEFAULT_EMAIL_ADDRESS = "defaultEmailAddress"; |
120 | |
final static String DEFAULT_PHONE_NUMBER = "defaultPhoneNumber"; |
121 | |
|
122 | |
} |
123 | |
|
124 | |
} |