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  
13  package org.kuali.student.contract.model.test.source;
14  
15  import java.io.Serializable;
16  
17  import javax.xml.bind.annotation.XmlAttribute;
18  import javax.xml.bind.annotation.XmlTransient;
19  
20  
21  @SuppressWarnings("serial")
22  @XmlTransient
23  public abstract class KeyEntityInfo extends EntityInfo implements KeyEntity, Serializable {
24  
25      @XmlAttribute
26      private String key;
27  
28      protected KeyEntityInfo() {
29          key = null;
30      }
31  
32      protected KeyEntityInfo(KeyEntity builder) {
33          super(builder);
34          this.key = builder.getKey();
35      }
36  
37      @Override
38      public String getKey() {
39          return key;
40      }
41  
42      /**
43       * The builder class for this abstract EntityInfo.
44       */
45  
46      public static class Builder extends EntityInfo.Builder implements  KeyEntity {
47  
48          private String key;
49  
50          public Builder() {}
51  
52          public Builder(KeyEntity entity) {
53              super(entity);
54              this.key = entity.getKey();
55          }
56  
57          @Override
58          public String getKey() {
59              return key;
60          }
61  
62          public void setKey(String key) {
63              this.key = key;
64          }
65      }
66  }