PageRenderTime 43ms CodeModel.GetById 16ms app.highlight 22ms RepoModel.GetById 0ms app.codeStats 0ms

/layers-store/src/main/java/org/ala/layers/dto/Distribution.java

http://alageospatialportal.googlecode.com/
Java | 560 lines | 461 code | 77 blank | 22 comment | 238 complexity | e127a2b15f4e8d984dd4964001ee076d MD5 | raw file
  1/**************************************************************************
  2 *  Copyright (C) 2010 Atlas of Living Australia
  3 *  All Rights Reserved.
  4 *
  5 *  The contents of this file are subject to the Mozilla Public
  6 *  License Version 1.1 (the "License"); you may not use this file
  7 *  except in compliance with the License. You may obtain a copy of
  8 *  the License at http://www.mozilla.org/MPL/
  9 *
 10 *  Software distributed under the License is distributed on an "AS
 11 *  IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 12 *  implied. See the License for the specific language governing
 13 *  rights and limitations under the License.
 14 ***************************************************************************/
 15
 16package org.ala.layers.dto;
 17
 18import org.codehaus.jackson.map.annotate.JsonSerialize;
 19
 20/**
 21 * This class serves as a model object for the "distributions" table
 22 * 
 23 * @author ajay
 24 */
 25
 26// @XmlRootElement(name="distribution")
 27// @XStreamAlias("distribution")
 28@JsonSerialize(include = JsonSerialize.Inclusion.NON_DEFAULT)
 29public class Distribution {
 30    public static final String EXPERT_DISTRIBUTION = "e";
 31    public static final String SPECIES_CHECKLIST = "c";
 32    Long gid;
 33    Long spcode;
 34    String scientific;
 35    String authority_;
 36    String common_nam;
 37    String family;
 38    String genus_name;
 39    String specific_n;
 40    Double min_depth;
 41    Double max_depth;
 42    Double pelagic_fl;
 43    String metadata_u;
 44    String geometry;
 45    String wmsurl;
 46    String lsid;
 47    String type;
 48    String area_name;
 49    String pid;
 50    String checklist_name;
 51    Double area_km;
 52    String notes;
 53    Long geom_idx;
 54    // additional fields
 55    String group_name;
 56    String family_lsid;
 57    String genus_lsid;
 58    Boolean estuarine_fl;
 59    Boolean coastal_fl;
 60    Boolean desmersal_fl;
 61    String caab_species_number;
 62    String caab_family_number;
 63    String data_resource_uid;
 64    String image_quality;
 65    String bounding_box;
 66
 67    public String getData_resource_uid() {
 68        return data_resource_uid;
 69    }
 70
 71    public void setData_resource_uid(String data_resource_uid) {
 72        this.data_resource_uid = data_resource_uid;
 73    }
 74
 75    public String getImage_quality() {
 76        return image_quality;
 77    }
 78
 79    public void setImage_quality(String image_quality) {
 80        this.image_quality = image_quality;
 81    }
 82
 83    public String getFamily_lsid() {
 84        return family_lsid;
 85    }
 86
 87    public void setFamily_lsid(String family_lsid) {
 88        this.family_lsid = family_lsid;
 89    }
 90
 91    public String getGenus_lsid() {
 92        return genus_lsid;
 93    }
 94
 95    public void setGenus_lsid(String genus_lsid) {
 96        this.genus_lsid = genus_lsid;
 97    }
 98
 99    public Boolean getEstuarine_fl() {
100        return estuarine_fl;
101    }
102
103    public void setEstuarine_fl(Integer estuarine_fl) {
104        this.estuarine_fl = estuarine_fl != null && estuarine_fl > 0 ? true : false;
105    }
106
107    public Boolean getCoastal_fl() {
108        return coastal_fl;
109    }
110
111    public void setCoastal_fl(Integer coastal_fl) {
112        this.coastal_fl = coastal_fl != null && coastal_fl > 0 ? true : false;
113    }
114
115    public Boolean getDesmersal_fl() {
116        return desmersal_fl;
117    }
118
119    public void setEstuarine_fl(Boolean estuarine_fl) {
120        this.estuarine_fl = estuarine_fl;
121    }
122
123    public void setCoastal_fl(Boolean coastal_fl) {
124        this.coastal_fl = coastal_fl;
125    }
126
127    public void setDesmersal_fl(Boolean desmersal_fl) {
128        this.desmersal_fl = desmersal_fl;
129    }
130
131    public void setDesmersal_fl(Integer desmersal_fl) {
132        this.desmersal_fl = desmersal_fl != null && desmersal_fl > 0 ? true : false;
133    }
134
135    public String getCaab_species_number() {
136        return caab_species_number;
137    }
138
139    public void setCaab_species_number(String caab_species_number) {
140        this.caab_species_number = caab_species_number;
141    }
142
143    public String getCaab_family_number() {
144        return caab_family_number;
145    }
146
147    public void setCaab_family_number(String caab_family_number) {
148        this.caab_family_number = caab_family_number;
149    }
150
151    public void setGid(Long gid) {
152        this.gid = gid;
153    }
154
155    public Long getGid() {
156        return gid;
157    }
158
159    public void setSpcode(Long spcode) {
160        this.spcode = spcode;
161    }
162
163    public void setSpcode(Double spcode) {
164        if (spcode != null) {
165            this.spcode = (long) (double) spcode;
166        }
167    }
168
169    public Long getSpcode() {
170        return spcode;
171    }
172
173    public void setScientific(String scientific) {
174        this.scientific = scientific;
175    }
176
177    public String getScientific() {
178        return scientific;
179    }
180
181    public void setAuthority_(String authority) {
182        this.authority_ = authority;
183    }
184
185    public String getAuthority_() {
186        return authority_;
187    }
188
189    public void setCommon_nam(String common_nam) {
190        this.common_nam = common_nam;
191    }
192
193    public String getCommon_nam() {
194        return common_nam;
195    }
196
197    public void setFamily(String family) {
198        this.family = family;
199    }
200
201    public String getFamily() {
202        return family;
203    }
204
205    public void setGenus_name(String genus_name) {
206        this.genus_name = genus_name;
207    }
208
209    public String getGenus_name() {
210        return genus_name;
211    }
212
213    public void setSpecific_n(String specific_n) {
214        this.specific_n = specific_n;
215    }
216
217    public String getSpecific_n() {
218        return specific_n;
219    }
220
221    public void setMin_depth(Double min_depth) {
222        this.min_depth = min_depth;
223    }
224
225    public Double getMin_depth() {
226        return min_depth;
227    }
228
229    public void setMax_depth(Double max_depth) {
230        this.max_depth = max_depth;
231    }
232
233    public Double getMax_depth() {
234        return max_depth;
235    }
236
237    public void setPelagic_fl(Double pelagic_fl) {
238        this.pelagic_fl = pelagic_fl;
239    }
240
241    public Double getPelagic_fl() {
242        return pelagic_fl;
243    }
244
245    public void setMetadata_u(String metadata_u) {
246        this.metadata_u = metadata_u;
247    }
248
249    public String getMetadata_u() {
250        return metadata_u;
251    }
252
253    public void setGeometry(String geometry) {
254        this.geometry = geometry;
255    }
256
257    public String getGeometry() {
258        return geometry;
259    }
260
261    public void setWmsurl(String wmsurl) {
262        this.wmsurl = wmsurl;
263    }
264
265    public String getWmsurl() {
266        return wmsurl;
267    }
268
269    public void setLsid(String lsid) {
270        this.lsid = lsid;
271    }
272
273    public String getLsid() {
274        return lsid;
275    }
276
277    public void setType(String type) {
278        this.type = type;
279    }
280
281    public String getType() {
282        return type;
283    }
284
285    public void setArea_name(String area_name) {
286        this.area_name = area_name;
287    }
288
289    public String getArea_name() {
290        return area_name;
291    }
292
293    public void setPid(String pid) {
294        this.pid = pid;
295    }
296
297    public String getPid() {
298        return pid;
299    }
300
301    public void setChecklist_name(String checklist_name) {
302        this.checklist_name = checklist_name;
303    }
304
305    public String getChecklist_name() {
306        return checklist_name;
307    }
308
309    public void setArea_km(Double area_km) {
310        this.area_km = area_km;
311    }
312
313    public Double getArea_km() {
314        return area_km;
315    }
316
317    public void setNotes(String notes) {
318        this.notes = notes;
319    }
320
321    public String getNotes() {
322        return notes;
323    }
324
325    public void setGeom_idx(Long geom_idx) {
326        this.geom_idx = geom_idx;
327    }
328
329    public Long getGeom_idx() {
330        return geom_idx;
331    }
332
333    public String getGroup_name() {
334        return group_name;
335    }
336
337    public void setGroup_name(String group_name) {
338        this.group_name = group_name;
339    }
340    
341
342    public String getBounding_box() {
343        return bounding_box;
344    }
345
346    public void setBounding_box(String bounding_box) {
347        this.bounding_box = bounding_box;
348    }
349
350    @Override
351    public int hashCode() {
352        final int prime = 31;
353        int result = 1;
354        result = prime * result + ((area_km == null) ? 0 : area_km.hashCode());
355        result = prime * result + ((area_name == null) ? 0 : area_name.hashCode());
356        result = prime * result + ((authority_ == null) ? 0 : authority_.hashCode());
357        result = prime * result + ((caab_family_number == null) ? 0 : caab_family_number.hashCode());
358        result = prime * result + ((caab_species_number == null) ? 0 : caab_species_number.hashCode());
359        result = prime * result + ((checklist_name == null) ? 0 : checklist_name.hashCode());
360        result = prime * result + ((coastal_fl == null) ? 0 : coastal_fl.hashCode());
361        result = prime * result + ((common_nam == null) ? 0 : common_nam.hashCode());
362        result = prime * result + ((data_resource_uid == null) ? 0 : data_resource_uid.hashCode());
363        result = prime * result + ((desmersal_fl == null) ? 0 : desmersal_fl.hashCode());
364        result = prime * result + ((estuarine_fl == null) ? 0 : estuarine_fl.hashCode());
365        result = prime * result + ((family == null) ? 0 : family.hashCode());
366        result = prime * result + ((family_lsid == null) ? 0 : family_lsid.hashCode());
367        result = prime * result + ((genus_lsid == null) ? 0 : genus_lsid.hashCode());
368        result = prime * result + ((genus_name == null) ? 0 : genus_name.hashCode());
369        result = prime * result + ((geom_idx == null) ? 0 : geom_idx.hashCode());
370        result = prime * result + ((geometry == null) ? 0 : geometry.hashCode());
371        result = prime * result + ((gid == null) ? 0 : gid.hashCode());
372        result = prime * result + ((group_name == null) ? 0 : group_name.hashCode());
373        result = prime * result + ((image_quality == null) ? 0 : image_quality.hashCode());
374        result = prime * result + ((lsid == null) ? 0 : lsid.hashCode());
375        result = prime * result + ((max_depth == null) ? 0 : max_depth.hashCode());
376        result = prime * result + ((metadata_u == null) ? 0 : metadata_u.hashCode());
377        result = prime * result + ((min_depth == null) ? 0 : min_depth.hashCode());
378        result = prime * result + ((notes == null) ? 0 : notes.hashCode());
379        result = prime * result + ((pelagic_fl == null) ? 0 : pelagic_fl.hashCode());
380        result = prime * result + ((pid == null) ? 0 : pid.hashCode());
381        result = prime * result + ((scientific == null) ? 0 : scientific.hashCode());
382        result = prime * result + ((spcode == null) ? 0 : spcode.hashCode());
383        result = prime * result + ((specific_n == null) ? 0 : specific_n.hashCode());
384        result = prime * result + ((type == null) ? 0 : type.hashCode());
385        result = prime * result + ((wmsurl == null) ? 0 : wmsurl.hashCode());
386        return result;
387    }
388
389    @Override
390    public boolean equals(Object obj) {
391        if (this == obj)
392            return true;
393        if (obj == null)
394            return false;
395        if (getClass() != obj.getClass())
396            return false;
397        Distribution other = (Distribution) obj;
398        if (area_km == null) {
399            if (other.area_km != null)
400                return false;
401        } else if (!area_km.equals(other.area_km))
402            return false;
403        if (area_name == null) {
404            if (other.area_name != null)
405                return false;
406        } else if (!area_name.equals(other.area_name))
407            return false;
408        if (authority_ == null) {
409            if (other.authority_ != null)
410                return false;
411        } else if (!authority_.equals(other.authority_))
412            return false;
413        if (caab_family_number == null) {
414            if (other.caab_family_number != null)
415                return false;
416        } else if (!caab_family_number.equals(other.caab_family_number))
417            return false;
418        if (caab_species_number == null) {
419            if (other.caab_species_number != null)
420                return false;
421        } else if (!caab_species_number.equals(other.caab_species_number))
422            return false;
423        if (checklist_name == null) {
424            if (other.checklist_name != null)
425                return false;
426        } else if (!checklist_name.equals(other.checklist_name))
427            return false;
428        if (coastal_fl == null) {
429            if (other.coastal_fl != null)
430                return false;
431        } else if (!coastal_fl.equals(other.coastal_fl))
432            return false;
433        if (common_nam == null) {
434            if (other.common_nam != null)
435                return false;
436        } else if (!common_nam.equals(other.common_nam))
437            return false;
438        if (data_resource_uid == null) {
439            if (other.data_resource_uid != null)
440                return false;
441        } else if (!data_resource_uid.equals(other.data_resource_uid))
442            return false;
443        if (desmersal_fl == null) {
444            if (other.desmersal_fl != null)
445                return false;
446        } else if (!desmersal_fl.equals(other.desmersal_fl))
447            return false;
448        if (estuarine_fl == null) {
449            if (other.estuarine_fl != null)
450                return false;
451        } else if (!estuarine_fl.equals(other.estuarine_fl))
452            return false;
453        if (family == null) {
454            if (other.family != null)
455                return false;
456        } else if (!family.equals(other.family))
457            return false;
458        if (family_lsid == null) {
459            if (other.family_lsid != null)
460                return false;
461        } else if (!family_lsid.equals(other.family_lsid))
462            return false;
463        if (genus_lsid == null) {
464            if (other.genus_lsid != null)
465                return false;
466        } else if (!genus_lsid.equals(other.genus_lsid))
467            return false;
468        if (genus_name == null) {
469            if (other.genus_name != null)
470                return false;
471        } else if (!genus_name.equals(other.genus_name))
472            return false;
473        if (geom_idx == null) {
474            if (other.geom_idx != null)
475                return false;
476        } else if (!geom_idx.equals(other.geom_idx))
477            return false;
478        if (geometry == null) {
479            if (other.geometry != null)
480                return false;
481        } else if (!geometry.equals(other.geometry))
482            return false;
483        if (gid == null) {
484            if (other.gid != null)
485                return false;
486        } else if (!gid.equals(other.gid))
487            return false;
488        if (group_name == null) {
489            if (other.group_name != null)
490                return false;
491        } else if (!group_name.equals(other.group_name))
492            return false;
493        if (image_quality == null) {
494            if (other.image_quality != null)
495                return false;
496        } else if (!image_quality.equals(other.image_quality))
497            return false;
498        if (lsid == null) {
499            if (other.lsid != null)
500                return false;
501        } else if (!lsid.equals(other.lsid))
502            return false;
503        if (max_depth == null) {
504            if (other.max_depth != null)
505                return false;
506        } else if (!max_depth.equals(other.max_depth))
507            return false;
508        if (metadata_u == null) {
509            if (other.metadata_u != null)
510                return false;
511        } else if (!metadata_u.equals(other.metadata_u))
512            return false;
513        if (min_depth == null) {
514            if (other.min_depth != null)
515                return false;
516        } else if (!min_depth.equals(other.min_depth))
517            return false;
518        if (notes == null) {
519            if (other.notes != null)
520                return false;
521        } else if (!notes.equals(other.notes))
522            return false;
523        if (pelagic_fl == null) {
524            if (other.pelagic_fl != null)
525                return false;
526        } else if (!pelagic_fl.equals(other.pelagic_fl))
527            return false;
528        if (pid == null) {
529            if (other.pid != null)
530                return false;
531        } else if (!pid.equals(other.pid))
532            return false;
533        if (scientific == null) {
534            if (other.scientific != null)
535                return false;
536        } else if (!scientific.equals(other.scientific))
537            return false;
538        if (spcode == null) {
539            if (other.spcode != null)
540                return false;
541        } else if (!spcode.equals(other.spcode))
542            return false;
543        if (specific_n == null) {
544            if (other.specific_n != null)
545                return false;
546        } else if (!specific_n.equals(other.specific_n))
547            return false;
548        if (type == null) {
549            if (other.type != null)
550                return false;
551        } else if (!type.equals(other.type))
552            return false;
553        if (wmsurl == null) {
554            if (other.wmsurl != null)
555                return false;
556        } else if (!wmsurl.equals(other.wmsurl))
557            return false;
558        return true;
559    }
560}