View Javadoc

1   /**
2    * Copyright 2011 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  package org.kuali.mobility.bus.entity;
16  
17  import java.io.Serializable;
18  import java.util.ArrayList;
19  import java.util.List;
20  
21  import javax.xml.bind.annotation.XmlElement;
22  import javax.xml.bind.annotation.XmlRootElement;
23  import javax.xml.bind.annotation.XmlSeeAlso;
24  
25  /**
26   *
27   * @author joseswan
28   */
29  @XmlRootElement(name = "busRoute")
30  @XmlSeeAlso({BusStopImpl.class})
31  public class BusRouteImpl implements Serializable, BusRoute {
32  
33  	private static final long serialVersionUID = 1043079110559627281L;
34  
35  	private long id;
36  
37      private String name;
38  
39      @XmlElement(name="stops")
40      private List<BusStopImpl> stops;
41  
42      private String color;
43      
44      private BusRoutePath path;
45  
46  
47      /**
48       * @return the id
49       */
50      public long getId() {
51          return id;
52      }
53  
54      /**
55       * @param id the id to set
56       */
57      public void setId(long id) {
58          this.id = id;
59      }
60  
61      /**
62       * @return the name
63       */
64      public String getName() {
65          return name;
66      }
67  
68      /**
69       * @param name the name to set
70       */
71      public void setName(String name) {
72          this.name = name;
73      }
74  
75      /**
76       * @return the stops
77       */
78      public List<? extends BusStopImpl> getStops() {
79          return stops;
80      }
81  
82      /**
83       * @param stops the stops to set
84       */
85      public void setStops(List<? extends BusStop> stops) {
86          this.stops = (List<BusStopImpl>)(List<?>) stops;
87      }
88  
89      public void addStop(BusStop stop)
90      {
91          if( null == getStops() ) {
92              setStops( new ArrayList<BusStopImpl>() );
93          }
94          stops.add((BusStopImpl)stop);
95      }
96  
97  
98  
99      /**
100      * @return the color
101      */
102     @Override
103     public String getColor() {
104         return color;
105     }
106 
107     /**
108      * @param color the color to set
109      */
110     @Override
111     public void setColor(String color) {
112         this.color = color;
113     }
114 
115     /**
116      * @return the path
117      */
118 	@Override
119 	public BusRoutePath getPath() {
120 		return path;
121 	}
122 
123 	/**
124      * @param path the path to set
125      */
126 	@Override
127 	public void setPath(BusRoutePath path) {
128 		this.path = path;
129 	}
130 
131 
132 }