View Javadoc
1   /*******************************************************************************
2    *   Gisgraphy Project 
3    * 
4    *   This library is free software; you can redistribute it and/or
5    *   modify it under the terms of the GNU Lesser General Public
6    *   License as published by the Free Software Foundation; either
7    *   version 2.1 of the License, or (at your option) any later version.
8    * 
9    *   This library is distributed in the hope that it will be useful,
10   *   but WITHOUT ANY WARRANTY; without even the implied warranty of
11   *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12   *   Lesser General Public License for more details.
13   * 
14   *   You should have received a copy of the GNU Lesser General Public
15   *   License along with this library; if not, write to the Free Software
16   *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
17   * 
18   *  Copyright 2008  Gisgraphy project 
19   *  David Masclet <davidmasclet@gisgraphy.com>
20   *  
21   *  
22   *******************************************************************************/
23  package com.gisgraphy.domain.geoloc.entity.event;
24  
25  import com.gisgraphy.domain.geoloc.entity.GisFeature;
26  
27  /**
28   * Event that occurred when all {@link GisFeature}s of a placetype are deleted
29   * 
30   * @author <a href="mailto:david.masclet@gisgraphy.com">David Masclet</a>
31   */
32  public class PlaceTypeDeleteAllEvent implements IGisRepositoryEvent {
33  
34      private Class<? extends GisFeature> placeType;
35  
36      /**
37       * @return The placetype that all gisfeature are deleted
38       */
39      public Class<? extends GisFeature> getPlaceType() {
40  	return placeType;
41      }
42  
43      /**
44       * Default constructor
45       * 
46       * @param placeType
47       *                The placetype that all GisFeature will be deleted
48       */
49      public PlaceTypeDeleteAllEvent(Class<? extends GisFeature> placeType) {
50  	super();
51  	this.placeType = placeType;
52      }
53  
54      @Override
55      public int hashCode() {
56  	final int prime = 31;
57  	int result = 1;
58  	result = prime * result + ((placeType == null) ? 0 : placeType.hashCode());
59  	return result;
60      }
61  
62      @Override
63      public boolean equals(Object obj) {
64  	if (this == obj)
65  	    return true;
66  	if (obj == null)
67  	    return false;
68  	if (getClass() != obj.getClass())
69  	    return false;
70  	PlaceTypeDeleteAllEvent other = (PlaceTypeDeleteAllEvent) obj;
71  	if (placeType == null) {
72  	    if (other.placeType != null)
73  		return false;
74  	} else if (!placeType.equals(other.placeType))
75  	    return false;
76  	return true;
77      }
78  
79  }