View Javadoc

1   /**
2    * Copyright 2011-2013 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.computerlabs.entity;
16  
17  import java.util.ArrayList;
18  import java.util.List;
19  import javax.xml.bind.annotation.XmlElement;
20  import javax.xml.bind.annotation.XmlRootElement;
21  import org.apache.commons.collections.CollectionUtils;
22  import org.kuali.mobility.computerlabs.util.LocationTransform;
23  
24  /**
25   *
26   * @author Joe Swanson <joseswan@umich.edu>
27   */
28  @XmlRootElement(name="labGroup")
29  public class LabGroupImpl implements LabGroup {
30  	private String name;
31  	@XmlElement(name="locations")
32  	private List<LocationImpl> locations;
33  
34  	public LabGroupImpl() {
35  		super();
36  		this.locations = new ArrayList<LocationImpl>();
37  	}
38  
39  	/**
40  	 * @return the name
41  	 */
42  	@Override
43  	public String getName() {
44  		return name;
45  	}
46  
47  	/**
48  	 * @param name the name to set
49  	 */
50  	@Override
51  	public void setName(String name) {
52  		this.name = name;
53  	}
54  
55  	/**
56  	 * @return the locations
57  	 */
58  	@Override
59  	public List<LocationImpl> getLocations() {
60  		return locations;
61  	}
62  
63  	/**
64  	 * @param locations the locations to set
65  	 */
66  	@Override
67  	public void setLocations(List<? extends Location> locations) {
68  		CollectionUtils.collect(locations, new LocationTransform(), this.locations);
69  	}
70  }