View Javadoc

1   /*
2    * Copyright 2010 The Kuali Foundation Licensed under the Educational
3    * Community License, Version 2.0 (the "License"); you may not use
4    * this file except in compliance with the License. You may obtain a
5    * copy of the License at http://www.osedu.org/licenses/ECL-2.0 Unless
6    * required by applicable law or agreed to in writing, software
7    * distributed under the License is distributed on an "AS IS" BASIS,
8    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
9    * implied. See the License for the specific language governing
10   * permissions and limitations under the License.
11   */
12  package org.kuali.student.contract.model.test.source;
13  
14  import java.io.Serializable;
15  
16  import javax.xml.bind.annotation.XmlAttribute;
17  import javax.xml.bind.annotation.XmlElement;
18  import javax.xml.bind.annotation.XmlTransient;
19  
20  import org.kuali.student.contract.model.test.source.Entity;
21  
22  @SuppressWarnings("serial")
23  @XmlTransient
24  public abstract class EntityInfo extends HasAttributesAndMetaInfo implements Entity, Serializable {
25  
26      @XmlElement
27      private String name;
28      @XmlElement
29      private RichTextInfo descr;
30      @XmlElement(required = true)
31      private String typeKey;
32      @XmlAttribute(required = true)
33      private String stateKey;
34  
35      protected EntityInfo() {
36          super();
37          name = null;
38          descr = null;
39          typeKey = null;
40          stateKey = null;
41      }
42  
43      protected EntityInfo(Entity builder) {
44          super(builder);
45          this.name = builder.getName();
46          this.descr = builder.getDescr();
47          this.typeKey = builder.getTypeKey();
48          this.stateKey = builder.getStateKey();
49      }
50  
51      @Override
52      public String getName() {
53          return name;
54      }
55  
56      @Override
57      public RichTextInfo getDescr() {
58          return descr;
59      }
60  
61      @Override
62      public String getTypeKey() {
63          return typeKey;
64      }
65  
66      @Override
67      public String getStateKey() {
68          return stateKey;
69      }
70  
71      /**
72       * The builder class for this abstract EntityInfo.
73       */
74      public static class Builder extends HasAttributesAndMetaInfo.Builder implements Entity {
75  
76          private String name;
77          private RichTextInfo descr;
78          private String typeKey;
79          private String stateKey;
80  
81          public Builder() {
82          }
83  
84          public Builder(Entity entity) {
85              super(entity);
86              this.name = entity.getName();
87              this.descr = entity.getDescr();
88              this.typeKey = entity.getTypeKey();
89              this.stateKey = entity.getStateKey();
90          }
91  
92          @Override
93          public String getName() {
94              return name;
95          }
96  
97          public void setName(String name) {
98              this.name = name;
99          }
100 
101         @Override
102         public RichTextInfo getDescr() {
103             return descr;
104         }
105 
106         public void setDescr(RichTextInfo descr) {
107             this.descr = descr;
108         }
109 
110         @Override
111         public String getTypeKey() {
112             return typeKey;
113         }
114 
115         public void setTypeKey(String typeKey) {
116             this.typeKey = typeKey;
117         }
118 
119         @Override
120         public String getStateKey() {
121             return stateKey;
122         }
123 
124         public void setStateKey(String stateKey) {
125             this.stateKey = stateKey;
126         }
127     }
128 }