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