Merge branch 'develop' of ssh://dev.e-taxonomy.eu/var/git/cdmlib into develop
[cdmlib.git] / cdmlib-services / src / main / java / eu / etaxonomy / cdm / api / service / dto / CollectionDTO.java
1 /**
2 * Copyright (C) 2018 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9 package eu.etaxonomy.cdm.api.service.dto;
10
11 import java.io.Serializable;
12
13 import eu.etaxonomy.cdm.model.agent.Institution;
14 import eu.etaxonomy.cdm.model.occurrence.Collection;
15
16 /**
17 * @author k.luther
18 * @since 21.06.2018
19 *
20 */
21 public class CollectionDTO implements Serializable{
22
23 private static final long serialVersionUID = -1840237876297997573L;
24
25 private String code;
26 private String codeStandard;
27 private String institute;
28 private String townOrLocation;
29
30
31 /**
32 * @param code
33 * @param codeStandard
34 * @param institute
35 * @param townOrLocation
36 */
37 public CollectionDTO(String code, String codeStandard, Institution institute, String townOrLocation) {
38 this.code = code;
39 this.codeStandard = codeStandard;
40 if (institute != null){
41 this.institute = institute.getTitleCache();
42 }
43 this.townOrLocation = townOrLocation;
44 }
45
46 /**
47 * @param collection
48 */
49 public CollectionDTO(Collection collection) {
50 this(collection.getCode(),collection.getCodeStandard(), collection.getInstitute(),collection.getTownOrLocation());
51
52 }
53
54 public String getCode() {
55 return code;
56 }
57 public void setCode(String code) {
58 this.code = code;
59 }
60 public String getCodeStandard() {
61 return codeStandard;
62 }
63 public void setCodeStandard(String codeStandard) {
64 this.codeStandard = codeStandard;
65 }
66 public String getInstitute() {
67 return institute;
68 }
69 public void setInstitute(String institute) {
70 this.institute = institute;
71 }
72 public String getTownOrLocation() {
73 return townOrLocation;
74 }
75 public void setTownOrLocation(String townOrLocation) {
76 this.townOrLocation = townOrLocation;
77 }
78
79 }