All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.resthub.web.validation.ValidationConstraint Maven / Gradle / Ivy

There is a newer version: 2.2.0
Show newest version
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);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy