001/**
002 * Copyright 2011 The Kuali Foundation Licensed under the
003 * Educational Community License, Version 2.0 (the "License"); you may
004 * not use this file except in compliance with the License. You may
005 * obtain a copy of the License at
006 *
007 * http://www.osedu.org/licenses/ECL-2.0
008 *
009 * Unless required by applicable law or agreed to in writing,
010 * software distributed under the License is distributed on an "AS IS"
011 * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
012 * or implied. See the License for the specific language governing
013 * permissions and limitations under the License.
014 */
015 
016package org.kuali.mobility.maps.entity;
017
018import java.io.Serializable;
019import java.util.HashSet;
020import java.util.Set;
021
022import javax.xml.bind.annotation.XmlElement;
023import javax.xml.bind.annotation.XmlRootElement;
024
025import flexjson.JSONSerializer;
026
027@XmlRootElement( name = "mapGroup")
028public class MapsGroup implements Serializable {
029
030        private static final long serialVersionUID = -4775149005202188253L;
031
032        private String id;
033        
034        private String name;
035    
036        private boolean active;
037    
038    private Set<Location> mapsLocations;
039
040    private Set<MapsGroup> mapsGroupChildren;
041    
042    public MapsGroup() {
043        mapsLocations = new HashSet<Location>();
044        mapsGroupChildren = new HashSet<MapsGroup>();
045    }
046    
047    public String toJson() {
048        return new JSONSerializer().exclude("*.class").include("mapsLocations").serialize(this);
049    }
050
051        public String getName() {
052                return name;
053        }
054
055        public void setName(String name) {
056                this.name = name;
057        }
058
059        public boolean isActive() {
060                return active;
061        }
062
063        public void setActive(boolean active) {
064                this.active = active;
065        }
066
067        @XmlElement( name = "locations")
068        public Set<Location> getMapsLocations() {
069                return mapsLocations;
070        }
071
072        public void setMapsLocations(Set<Location> mapsLocations) {
073                this.mapsLocations = mapsLocations;
074        }
075
076        @XmlElement( name = "mapGroupChildren")
077        public Set<MapsGroup> getMapsGroupChildren() {
078                return mapsGroupChildren;
079        }
080
081        public void setMapsGroupChildren(Set<MapsGroup> mapsGroupChildren) {
082                this.mapsGroupChildren = mapsGroupChildren;
083        }
084
085        public String getId() {
086                return id;
087        }
088
089        public void setId(String id) {
090                this.id = id;
091        }
092}