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   
16  package org.kuali.mobility.maps.entity;
17  
18  import java.io.Serializable;
19  import java.util.HashSet;
20  import java.util.Set;
21  
22  import javax.xml.bind.annotation.XmlElement;
23  import javax.xml.bind.annotation.XmlRootElement;
24  
25  import flexjson.JSONSerializer;
26  
27  @XmlRootElement( name = "mapGroup")
28  public class MapsGroup implements Serializable {
29  
30  	private static final long serialVersionUID = -4775149005202188253L;
31  
32  	private String id;
33  	
34  	private String name;
35      
36  	private boolean active;
37      
38      private Set<Location> mapsLocations;
39  
40      private Set<MapsGroup> mapsGroupChildren;
41      
42      public MapsGroup() {
43      	mapsLocations = new HashSet<Location>();
44      	mapsGroupChildren = new HashSet<MapsGroup>();
45      }
46      
47      public String toJson() {
48          return new JSONSerializer().exclude("*.class").include("mapsLocations").serialize(this);
49      }
50  
51  	public String getName() {
52  		return name;
53  	}
54  
55  	public void setName(String name) {
56  		this.name = name;
57  	}
58  
59  	public boolean isActive() {
60  		return active;
61  	}
62  
63  	public void setActive(boolean active) {
64  		this.active = active;
65  	}
66  
67  	@XmlElement( name = "locations")
68  	public Set<Location> getMapsLocations() {
69  		return mapsLocations;
70  	}
71  
72  	public void setMapsLocations(Set<Location> mapsLocations) {
73  		this.mapsLocations = mapsLocations;
74  	}
75  
76  	@XmlElement( name = "mapGroupChildren")
77  	public Set<MapsGroup> getMapsGroupChildren() {
78  		return mapsGroupChildren;
79  	}
80  
81  	public void setMapsGroupChildren(Set<MapsGroup> mapsGroupChildren) {
82  		this.mapsGroupChildren = mapsGroupChildren;
83  	}
84  
85  	public String getId() {
86  		return id;
87  	}
88  
89  	public void setId(String id) {
90  		this.id = id;
91  	}
92  }