1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.krms.api.repository.agenda; |
17 | |
|
18 | |
import java.io.Serializable; |
19 | |
import java.util.Collection; |
20 | |
|
21 | |
import javax.xml.bind.annotation.XmlAccessType; |
22 | |
import javax.xml.bind.annotation.XmlAccessorType; |
23 | |
import javax.xml.bind.annotation.XmlAnyElement; |
24 | |
import javax.xml.bind.annotation.XmlElement; |
25 | |
import javax.xml.bind.annotation.XmlRootElement; |
26 | |
import javax.xml.bind.annotation.XmlType; |
27 | |
|
28 | |
import org.apache.commons.lang.builder.EqualsBuilder; |
29 | |
import org.apache.commons.lang.builder.HashCodeBuilder; |
30 | |
import org.apache.commons.lang.builder.ToStringBuilder; |
31 | |
import org.kuali.rice.core.api.CoreConstants; |
32 | |
import org.kuali.rice.core.api.mo.ModelBuilder; |
33 | |
|
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
@XmlRootElement(name = AgendaTreeSubAgendaEntry.Constants.ROOT_ELEMENT_NAME) |
41 | |
@XmlAccessorType(XmlAccessType.NONE) |
42 | |
@XmlType(name = AgendaTreeSubAgendaEntry.Constants.TYPE_NAME, propOrder = { |
43 | |
AgendaTreeSubAgendaEntry.Elements.AGENDA_ITEM_ID, |
44 | |
AgendaTreeSubAgendaEntry.Elements.SUB_AGENDA_ID, |
45 | |
CoreConstants.CommonElements.FUTURE_ELEMENTS |
46 | |
}) |
47 | 1 | public final class AgendaTreeSubAgendaEntry implements AgendaTreeEntryDefinition { |
48 | |
|
49 | |
private static final long serialVersionUID = 8594116503548506936L; |
50 | |
|
51 | |
@XmlElement(name = Elements.AGENDA_ITEM_ID, required = true) |
52 | |
private final String agendaItemId; |
53 | |
|
54 | |
@XmlElement(name = Elements.SUB_AGENDA_ID, required = true) |
55 | |
private final String subAgendaId; |
56 | |
|
57 | 4 | @SuppressWarnings("unused") |
58 | |
@XmlAnyElement |
59 | |
private final Collection<org.w3c.dom.Element> _futureElements = null; |
60 | |
|
61 | |
|
62 | |
|
63 | |
|
64 | 3 | private AgendaTreeSubAgendaEntry() { |
65 | 3 | this.agendaItemId = null; |
66 | 3 | this.subAgendaId = null; |
67 | 3 | } |
68 | |
|
69 | 1 | private AgendaTreeSubAgendaEntry(Builder builder) { |
70 | 1 | this.agendaItemId = builder.getAgendaItemId(); |
71 | 1 | this.subAgendaId = builder.getSubAgendaId(); |
72 | 1 | } |
73 | |
|
74 | |
@Override |
75 | |
public String getAgendaItemId() { |
76 | 0 | return agendaItemId; |
77 | |
} |
78 | |
|
79 | |
public String getSubAgendaId() { |
80 | 0 | return this.subAgendaId; |
81 | |
} |
82 | |
|
83 | 1 | public static class Builder implements ModelBuilder, Serializable { |
84 | |
|
85 | |
private static final long serialVersionUID = 3548736700798501429L; |
86 | |
|
87 | |
private String agendaItemId; |
88 | |
private String subAgendaId; |
89 | |
|
90 | |
|
91 | |
|
92 | |
|
93 | 1 | private Builder(String agendaItemId, String subAgendaId) { |
94 | 1 | setAgendaItemId(agendaItemId); |
95 | 1 | setSubAgendaId(subAgendaId); |
96 | 1 | } |
97 | |
|
98 | |
public static Builder create(String agendaItemId, String subAgendaId){ |
99 | 1 | return new Builder(agendaItemId, subAgendaId); |
100 | |
} |
101 | |
|
102 | |
public String getAgendaItemId() { |
103 | 1 | return this.agendaItemId; |
104 | |
} |
105 | |
|
106 | |
public String getSubAgendaId() { |
107 | 1 | return this.subAgendaId; |
108 | |
} |
109 | |
|
110 | |
public void setAgendaItemId(String agendaItemId) { |
111 | 1 | if (agendaItemId == null) { |
112 | 0 | throw new IllegalArgumentException("agendaItemId was null"); |
113 | |
} |
114 | 1 | this.agendaItemId = agendaItemId; |
115 | 1 | } |
116 | |
|
117 | |
public void setSubAgendaId(String subAgendaId) { |
118 | 1 | if (subAgendaId == null) { |
119 | 0 | throw new IllegalArgumentException("subAgendaId was null"); |
120 | |
} |
121 | 1 | this.subAgendaId = subAgendaId; |
122 | 1 | } |
123 | |
|
124 | |
@Override |
125 | |
public AgendaTreeSubAgendaEntry build() { |
126 | 1 | return new AgendaTreeSubAgendaEntry(this); |
127 | |
} |
128 | |
|
129 | |
} |
130 | |
|
131 | |
@Override |
132 | |
public int hashCode() { |
133 | 0 | return HashCodeBuilder.reflectionHashCode(this, Constants.HASH_CODE_EQUALS_EXCLUDE); |
134 | |
} |
135 | |
|
136 | |
@Override |
137 | |
public boolean equals(Object obj) { |
138 | 1 | return EqualsBuilder.reflectionEquals(obj, this, Constants.HASH_CODE_EQUALS_EXCLUDE); |
139 | |
} |
140 | |
|
141 | |
@Override |
142 | |
public String toString() { |
143 | 0 | return ToStringBuilder.reflectionToString(this); |
144 | |
} |
145 | |
|
146 | |
|
147 | |
|
148 | |
|
149 | 0 | static class Constants { |
150 | |
final static String ROOT_ELEMENT_NAME = "agendaTreeSubAgendaEntry"; |
151 | |
final static String TYPE_NAME = "AgendaTreeSubAgendaEntryType"; |
152 | 1 | final static String[] HASH_CODE_EQUALS_EXCLUDE = { "_elements" }; |
153 | |
} |
154 | |
|
155 | |
|
156 | |
|
157 | |
|
158 | |
|
159 | 0 | static class Elements { |
160 | |
final static String AGENDA_ITEM_ID = "agendaItemId"; |
161 | |
final static String SUB_AGENDA_ID = "subAgendaId"; |
162 | |
} |
163 | |
|
164 | |
} |