Skip to content

Commit f555e58

Browse files
committed
Update PropertyDescriptor to support missing value and set-method chaining
SVN r64539 |2019-09-24 18:51:22 +0000
1 parent 87af6db commit f555e58

File tree

1 file changed

+39
-12
lines changed

1 file changed

+39
-12
lines changed

java/src/org/labkey/remoteapi/domain/PropertyDescriptor.java

Lines changed: 39 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public class PropertyDescriptor extends ResponseObject
1515
private String _format;
1616
private Boolean _measure = false;
1717
private Boolean _dimension = false;
18+
private Boolean _mvEnabled = false;
1819
private String _propertyURI;
1920
private String _rangeURI;
2021
private String _lookupSchema;
@@ -72,6 +73,8 @@ public PropertyDescriptor(JSONObject json)
7273
_lookupQuery = (String)json.get("lookupQuery");
7374
if (json.get("lookupContainer") != null)
7475
_lookupContainer = (String)json.get("lookupContainer");
76+
if (json.get("mvEnabled") != null)
77+
_mvEnabled = (Boolean)json.get("mvEnabled");
7578
}
7679

7780
public JSONObject toJSONObject()
@@ -90,6 +93,7 @@ public JSONObject toJSONObject()
9093
result.put("propertyId", _propertyId);
9194
result.put("format", _format);
9295
result.put("measure", _measure);
96+
result.put("mvEnabled", _mvEnabled);
9397
result.put("dimension", _dimension);
9498
result.put("propertyURI", _propertyURI);
9599
result.put("rangeURI", _rangeURI);
@@ -109,11 +113,12 @@ public JSONObject toJSONObject()
109113
* @param query
110114
* @param container set to null for current folder
111115
*/
112-
public void setLookup(String schema, String query, String container)
116+
public PropertyDescriptor setLookup(String schema, String query, String container)
113117
{
114118
_lookupSchema = schema;
115119
_lookupQuery = query;
116120
_lookupContainer = container;
121+
return this;
117122
}
118123

119124
public String getName()
@@ -131,108 +136,130 @@ public String getLabel()
131136
return _label;
132137
}
133138

134-
public void setLabel(String label)
139+
public PropertyDescriptor setLabel(String label)
135140
{
136141
_label = label;
142+
return this;
137143
}
138144

139145
public String getDescription()
140146
{
141147
return _description;
142148
}
143149

144-
public void setDescription(String description)
150+
public PropertyDescriptor setDescription(String description)
145151
{
146152
_description = description;
153+
return this;
147154
}
148155

149156
public Boolean getHidden()
150157
{
151158
return _hidden;
152159
}
153160

154-
public void setHidden(Boolean hidden)
161+
public PropertyDescriptor setHidden(Boolean hidden)
155162
{
156163
_hidden = hidden;
164+
return this;
157165
}
158166

159167
public Boolean getRequired()
160168
{
161169
return _required;
162170
}
163171

164-
public void setRequired(Boolean required)
172+
public PropertyDescriptor setRequired(Boolean required)
165173
{
166174
_required = required;
175+
return this;
167176
}
168177

169178
public String getPHI()
170179
{
171180
return _PHI;
172181
}
173182

174-
public void setPHI(String PHI)
183+
public PropertyDescriptor setPHI(String PHI)
175184
{
176185
_PHI = PHI;
186+
return this;
177187
}
178188

179189
public Long getPropertyId()
180190
{
181191
return _propertyId;
182192
}
183193

184-
public void setPropertyId(Long propertyId)
194+
public PropertyDescriptor setPropertyId(Long propertyId)
185195
{
186196
_propertyId = propertyId;
197+
return this;
187198
}
188199

189200
public String getFormat()
190201
{
191202
return _format;
192203
}
193204

194-
public void setFormat(String format)
205+
public PropertyDescriptor setFormat(String format)
195206
{
196207
_format = format;
208+
return this;
197209
}
198210

199211
public Boolean getMeasure()
200212
{
201213
return _measure;
202214
}
203215

204-
public void setMeasure(Boolean measure)
216+
public PropertyDescriptor setMeasure(Boolean measure)
205217
{
206218
_measure = measure;
219+
return this;
207220
}
208221

209222
public Boolean getDimension()
210223
{
211224
return _dimension;
212225
}
213226

214-
public void setDimension(Boolean dimension)
227+
public PropertyDescriptor setDimension(Boolean dimension)
215228
{
216229
_dimension = dimension;
230+
return this;
217231
}
218232

219233
public String getPropertyURI()
220234
{
221235
return _propertyURI;
222236
}
223237

224-
public void setPropertyURI(String propertyURI)
238+
public PropertyDescriptor setPropertyURI(String propertyURI)
225239
{
226240
_propertyURI = propertyURI;
241+
return this;
227242
}
228243

229244
public String getRangeURI()
230245
{
231246
return _rangeURI;
232247
}
233248

234-
public void setRangeURI(String rangeURI)
249+
public PropertyDescriptor setRangeURI(String rangeURI)
235250
{
236251
_rangeURI = rangeURI;
252+
return this;
253+
}
254+
255+
public Boolean getMvEnabled()
256+
{
257+
return _mvEnabled;
258+
}
259+
260+
public PropertyDescriptor setMvEnabled(Boolean mvEnabled)
261+
{
262+
_mvEnabled = mvEnabled;
263+
return this;
237264
}
238265
}

0 commit comments

Comments
 (0)