View Javadoc

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