/** * Return a response object that sets the status to "success" */ public RestResponseStatus buildSuccess() { this.status = RestResponseStatus.STATUS_SUCCESS; return new RestResponseStatus(this); }
private List<LabelValue> convertToLabelValue(String[] values) { if (values != null) { List<LabelValue> list = new ArrayList<>(); for (String value : values) { LabelValue labelValue = new LabelValue(); labelValue.setLabel(value); labelValue.setValue(value); list.add(labelValue); } return list; } return null; }
public FieldRulePropertyBuilder addSelectableValue(String label, String value) { if (selectableValues == null) { selectableValues = new ArrayList<>(); } selectableValues.add(new LabelValue(label, value)); return this; }
@JsonIgnore public String getStringValue() { if (StringUtils.isBlank(value) && values != null && !values.isEmpty()) { //join the values into a string comma separated StringBuffer sb = new StringBuffer(); for (LabelValue lv : getValues()) { if (!sb.toString().equalsIgnoreCase("")) { sb.append(","); } sb.append(lv.getValue()); } return sb.toString(); } else { return value; } }
private LabelValue convertToLabelValue(PropertyLabelValue propertyLabelValue) { if (propertyLabelValue != null) { LabelValue labelValue = new LabelValue(); labelValue.setLabel(propertyLabelValue.label()); labelValue.setValue(propertyLabelValue.value()); return labelValue; } return null; }
public FieldRulePropertyBuilder addAdditionalProperty(String label, String value) { if (additionalProperties == null) { additionalProperties = new ArrayList<>(); } additionalProperties.add(new LabelValue(label, value)); return this; }
/** * Return a response object that sets the status to "error" */ public RestResponseStatus buildError() { this.status = RestResponseStatus.STATUS_ERROR; return new RestResponseStatus(this); }
public void addSelectableValue(String label, String value) { getSelectableValues().add(new LabelValue(label, value)); }