@RequestMapping(value = "/instance/enabled", consumes = "application/json", method = RequestMethod.POST) void setInstanceEnabled(@RequestBody Map<String, Boolean> enabledWrapper) { Boolean enabled = enabledWrapper.get("enabled"); if (enabled == null) { throw new ValidationException("The field 'enabled' must be set.", null); } setInstanceEnabled(enabled); }
private void validate(String newValue) { for (PropertyChangeValidator v: validators) { try { v.validate(newValue); } catch (ValidationException e) { throw e; } catch (Throwable e) { throw new ValidationException("Unexpected exception during validation", e); } } }
private void validate(String newValue) { for (PropertyChangeValidator v: validators) { try { v.validate(newValue); } catch (ValidationException e) { throw e; } catch (Throwable e) { throw new ValidationException("Unexpected exception during validation", e); } } }
@RequestMapping(value = "/instance/enabled", consumes = "application/json", method = RequestMethod.POST) void setInstanceEnabled(@RequestBody Map<String, Boolean> enabledWrapper) { Boolean enabled = enabledWrapper.get("enabled"); if (enabled == null) { throw new ValidationException("The field 'enabled' must be set.", null); } setInstanceEnabled(enabled); }