1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package org.opencastproject.adopter.registration.dto;
23
24 import com.google.gson.Gson;
25 import com.google.gson.annotations.SerializedName;
26
27
28
29
30 public class GeneralData {
31
32
33 private static final Gson gson = new Gson();
34
35
36
37
38
39
40 @SerializedName("adopter_key")
41 private String adopterKey;
42
43
44 @SerializedName("organisation_name")
45 private final String organisationName;
46
47
48 @SerializedName("department_name")
49 private final String departmentName;
50
51
52 @SerializedName("first_name")
53 private final String firstName;
54
55
56 @SerializedName("last_name")
57 private final String lastName;
58
59
60 private final String country;
61
62
63 private final String city;
64
65
66 @SerializedName("postal_code")
67 private final String postalCode;
68
69
70 private final String street;
71
72
73 @SerializedName("street_no")
74 private final String streetNo;
75
76
77 private final String email;
78
79
80 @SerializedName("contact_me")
81 private final boolean allowContact;
82
83
84 @SerializedName("system_type")
85 private final String systemType;
86
87
88 @SerializedName("send_errors")
89 private final boolean allowErrorReports;
90
91
92 @SerializedName("send_usage")
93 private final boolean allowStatistics;
94
95
96
97
98
99
100 public GeneralData(Adopter adopter) {
101 this.adopterKey = adopter.getAdopterKey();
102 this.organisationName = adopter.getOrganisationName();
103 this.departmentName = adopter.getDepartmentName();
104 this.firstName = adopter.getFirstName();
105 this.lastName = adopter.getLastName();
106 this.country = adopter.getCountry();
107 this.city = adopter.getCity();
108 this.postalCode = adopter.getPostalCode();
109 this.street = adopter.getStreet();
110 this.streetNo = adopter.getStreetNo();
111 this.email = adopter.getEmail();
112 this.allowContact = adopter.allowsContacting();
113 this.systemType = adopter.systemType();
114 this.allowErrorReports = adopter.allowsErrorReports();
115 this.allowStatistics = adopter.allowsStatistics();
116 }
117
118
119
120
121
122 public String jsonify() {
123 return gson.toJson(this);
124 }
125
126
127
128
129
130
131 public String getAdopterKey() {
132 return adopterKey;
133 }
134
135 public void setAdopterKey(String key) {
136 this.adopterKey = key;
137 }
138
139 public String getOrganisationName() {
140 return organisationName;
141 }
142
143 public String getDepartmentName() {
144 return departmentName;
145 }
146
147 public String getFirstName() {
148 return firstName;
149 }
150
151 public String getLastName() {
152 return lastName;
153 }
154
155 public String getCountry() {
156 return country;
157 }
158
159 public String getCity() {
160 return city;
161 }
162
163 public String getPostalCode() {
164 return postalCode;
165 }
166
167 public String getStreet() {
168 return street;
169 }
170
171 public String getStreetNo() {
172 return streetNo;
173 }
174
175 public String getEmail() {
176 return email;
177 }
178
179 public String getContactMe() {
180 return Boolean.toString(allowContact);
181 }
182
183 public String getSystemType() {
184 return systemType;
185 }
186
187 public String getErrorReports() {
188 return Boolean.toString(allowErrorReports);
189 }
190
191 public String getStatisticss() {
192 return Boolean.toString(allowStatistics);
193 }
194 }