public String getLabelsString() { final String labels; if (this.labels != null && this.labels.length > 0) { labels = LabelCmdUtils.toJsonArray(this.labels).toString(); } else { labels = ""; } return labels; }
public void setLabelsByString(String labels) { if (TextUtils.isEmpty(labels)) { this.labels = null; return; } UserLabel[] labelArray = null; try { labelArray = LabelCmdUtils.toUserLabelArray(new JSONArray(labels)); } catch (JSONException e) { L.w(TAG, e); } finally { this.labels = labelArray; } }