1 package org.kuali.ole.deliver.api;
2
3 import org.kuali.rice.core.api.mo.AbstractDataTransferObject;
4 import org.kuali.rice.core.api.mo.ModelBuilder;
5 import org.kuali.rice.kim.api.identity.email.EntityEmail;
6 import org.kuali.rice.krms.api.KrmsConstants;
7
8 import javax.xml.bind.annotation.*;
9 import java.io.Serializable;
10
11
12
13
14 @XmlRootElement(name = OleEntityEmailDefinition.Constants.ROOT_ELEMENT_NAME)
15 @XmlAccessorType(XmlAccessType.NONE)
16 @XmlType(name = OleEntityEmailDefinition.Constants.TYPE_NAME, propOrder = {
17 OleEntityEmailDefinition.Elements.OLE_EMAIL,
18 OleEntityEmailDefinition.Elements.ENTITY_EMAIL
19 })
20 public class OleEntityEmailDefinition extends AbstractDataTransferObject implements OleEntityEmailContract {
21
22 private static final long serialVersionUID = 1L;
23
24 @XmlElement(name = Elements.OLE_EMAIL, required = false)
25 private final OleEmailDefinition oleEmailBo;
26
27 @XmlElement(name = Elements.ENTITY_EMAIL, required = false)
28 private final EntityEmail entityEmailBo;
29
30 public OleEntityEmailDefinition() {
31 oleEmailBo = null;
32 entityEmailBo = null;
33 }
34
35 public OleEntityEmailDefinition(Builder builder) {
36 oleEmailBo = builder.getOleEmailBo().build();
37 entityEmailBo = builder.getEntityEmailBo().build();
38
39 }
40
41 @Override
42 public EntityEmail getEntityEmailBo() {
43 return entityEmailBo;
44 }
45
46 @Override
47 public OleEmailDefinition getOleEmailBo() {
48 return oleEmailBo;
49 }
50
51 public static class Builder implements OleEntityEmailContract, ModelBuilder, Serializable {
52 private static final long serialVersionUID = 1L;
53
54 public OleEmailDefinition.Builder oleEmailBo;
55 public EntityEmail.Builder entityEmailBo;
56
57 public String patronNoteId;
58 public String olePatronId;
59 public String patronNoteTypeId;
60 public String patronNoteText;
61 public OlePatronNoteTypeDefinition.Builder olePatronNoteType;
62 public OlePatronDefinition.Builder olePatron;
63 public Long versionNumber;
64 public boolean active;
65 public String objectId;
66
67 private Builder(OleEmailDefinition.Builder oleEmailBo, EntityEmail.Builder entityEmailBo) {
68 setOleEmailBo(oleEmailBo);
69 setEntityEmailBo(entityEmailBo);
70 }
71
72 public static Builder create(OleEmailDefinition.Builder oleEmailBo, EntityEmail.Builder entityEmailBo) {
73 return new Builder(oleEmailBo, entityEmailBo);
74 }
75
76 public static Builder create(OleEntityEmailContract oleEntityEmailContract) {
77 Builder builder = Builder.create(OleEmailDefinition.Builder.create(oleEntityEmailContract.getOleEmailBo()), EntityEmail.Builder.create(oleEntityEmailContract.getEntityEmailBo()));
78 return builder;
79 }
80
81 @Override
82 public OleEmailDefinition.Builder getOleEmailBo() {
83 return oleEmailBo;
84 }
85
86 public EntityEmail.Builder getEntityEmailBo() {
87 return this.entityEmailBo;
88 }
89
90 public void setOleEmailBo(OleEmailDefinition.Builder oleEmailBo) {
91 this.oleEmailBo = oleEmailBo;
92 }
93
94 public void setEntityEmailBo(EntityEmail.Builder entityEmailBo) {
95 this.entityEmailBo = entityEmailBo;
96 }
97
98 @Override
99 public OleEntityEmailDefinition build() {
100 return new OleEntityEmailDefinition(this);
101 }
102 }
103
104 static class Constants {
105 public static final String ROOT_ELEMENT_NAME = "oleEntityEmailDefinition";
106 public static final String TYPE_NAME = "oleEntityEmailDefinitionType";
107 }
108
109 static class Elements {
110 public static final String OLE_EMAIL = "oleEmailBo";
111 public static final String ENTITY_EMAIL = "entityEmailBo";
112
113 }
114
115 public static class Cache {
116 public static final String NAME = KrmsConstants.Namespaces.KRMS_NAMESPACE_2_0 + "/" + Constants.TYPE_NAME;
117 }
118 }