org.resthub.web.validation.ValidationConstraint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of resthub-web-server Show documentation
Show all versions of resthub-web-server Show documentation
RESThub support for REST webservices based on Spring MVC
package org.resthub.web.validation;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.util.HashMap;
import java.util.Map;
@JsonInclude(JsonInclude.Include.NON_NULL)
public class ValidationConstraint {
private String type;
private String message;
private Map attributes;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
@JsonAnyGetter
public Map getAttributes() {
return attributes;
}
@JsonAnySetter
public void setAttributes(Map attributes) {
this.attributes = attributes;
}
public Object addAttribute(String attrKey, Object attribute) {
if (this.attributes == null) {
this.attributes = new HashMap();
}
return this.attributes.put(attrKey, attribute);
}
}