View Javadoc
1   /**
2    * Copyright 2004-2014 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.XmlTransient;
22  
23  
24  @SuppressWarnings("serial")
25  @XmlTransient
26  public abstract class KeyEntityInfo extends EntityInfo implements KeyEntity, Serializable {
27  
28      @XmlAttribute
29      private String key;
30  
31      protected KeyEntityInfo() {
32          key = null;
33      }
34  
35      protected KeyEntityInfo(KeyEntity builder) {
36          super(builder);
37          this.key = builder.getKey();
38      }
39  
40      @Override
41      public String getKey() {
42          return key;
43      }
44  
45      /**
46       * The builder class for this abstract EntityInfo.
47       */
48  
49      public static class Builder extends EntityInfo.Builder implements  KeyEntity {
50  
51          private String key;
52  
53          public Builder() {}
54  
55          public Builder(KeyEntity entity) {
56              super(entity);
57              this.key = entity.getKey();
58          }
59  
60          @Override
61          public String getKey() {
62              return key;
63          }
64  
65          public void setKey(String key) {
66              this.key = key;
67          }
68      }
69  }