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 IdEntityInfo extends EntityInfo implements IdEntity, Serializable {
24  
25      @XmlAttribute
26      private String id;
27  
28      protected IdEntityInfo() {
29          super ();
30          id = null;
31      }
32  
33      protected IdEntityInfo(IdEntity builder) {
34          super(builder);
35          this.id = builder.getId();
36      }
37  
38      @Override
39      public String getId() {
40          return id;
41      }
42  
43      /**
44       * The builder class for this abstract EntityInfo.
45       */
46  
47      public static class Builder extends EntityInfo.Builder implements IdEntity {
48  
49          private String id;
50  
51          public Builder() {}
52  
53          public Builder(IdEntity entity) {
54              super(entity);
55              this.id = entity.getId();
56          }
57  
58          @Override
59          public String getId() {
60              return id;
61          }
62  
63          public void setId(String id) {
64              this.id = id;
65          }
66      }
67  }