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

com.indeed.rabbitmq.admin.pojo.OperatorPolicy Maven / Gradle / Ivy


package com.indeed.rabbitmq.admin.pojo;

import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;


/**
 * Describes a RabbitMQ operator policy on a set of queues.
 * 
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
    "vhost",
    "name",
    "pattern",
    "apply-to",
    "definition",
    "priority"
})
public class OperatorPolicy {

    /**
     * The virtual host that contains this operator policy.
     * 
     */
    @JsonProperty("vhost")
    @JsonPropertyDescription("The virtual host that contains this operator policy.")
    private String vhost;
    /**
     * The unique name of this operator policy.
     * 
     */
    @JsonProperty("name")
    @JsonPropertyDescription("The unique name of this operator policy.")
    private String name;
    /**
     * A pattern that matches the RabbitMQ queues to which this operator policy applies.
     * 
     */
    @JsonProperty("pattern")
    @JsonPropertyDescription("A pattern that matches the RabbitMQ queues to which this operator policy applies.")
    private Pattern pattern;
    /**
     * Indicates which entities to which this operator policy applies (only 'queues')
     * 
     */
    @JsonProperty("apply-to")
    @JsonPropertyDescription("Indicates which entities to which this operator policy applies (only 'queues')")
    private OperatorPolicy.ApplyTo applyTo = OperatorPolicy.ApplyTo.fromValue("queues");
    /**
     * 
     * Corresponds to the "definition" property.The definitions to apply to a RabbitMQ operator policy.
     * 
     */
    @JsonProperty("definition")
    @JsonPropertyDescription("The definitions to apply to a RabbitMQ operator policy.")
    private OperatorPolicyDefinition operatorPolicyDefinition;
    /**
     * The policy priority level.
     * 
     */
    @JsonProperty("priority")
    @JsonPropertyDescription("The policy priority level.")
    private Long priority;
    @JsonIgnore
    private Map additionalProperties = new HashMap();

    /**
     * The virtual host that contains this operator policy.
     * 
     */
    @JsonProperty("vhost")
    public String getVhost() {
        return vhost;
    }

    /**
     * The virtual host that contains this operator policy.
     * 
     */
    @JsonProperty("vhost")
    public void setVhost(String vhost) {
        this.vhost = vhost;
    }

    public OperatorPolicy withVhost(String vhost) {
        this.vhost = vhost;
        return this;
    }

    /**
     * The unique name of this operator policy.
     * 
     */
    @JsonProperty("name")
    public String getName() {
        return name;
    }

    /**
     * The unique name of this operator policy.
     * 
     */
    @JsonProperty("name")
    public void setName(String name) {
        this.name = name;
    }

    public OperatorPolicy withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * A pattern that matches the RabbitMQ queues to which this operator policy applies.
     * 
     */
    @JsonProperty("pattern")
    public Pattern getPattern() {
        return pattern;
    }

    /**
     * A pattern that matches the RabbitMQ queues to which this operator policy applies.
     * 
     */
    @JsonProperty("pattern")
    public void setPattern(Pattern pattern) {
        this.pattern = pattern;
    }

    public OperatorPolicy withPattern(Pattern pattern) {
        this.pattern = pattern;
        return this;
    }

    /**
     * Indicates which entities to which this operator policy applies (only 'queues')
     * 
     */
    @JsonProperty("apply-to")
    public OperatorPolicy.ApplyTo getApplyTo() {
        return applyTo;
    }

    /**
     * Indicates which entities to which this operator policy applies (only 'queues')
     * 
     */
    @JsonProperty("apply-to")
    public void setApplyTo(OperatorPolicy.ApplyTo applyTo) {
        this.applyTo = applyTo;
    }

    public OperatorPolicy withApplyTo(OperatorPolicy.ApplyTo applyTo) {
        this.applyTo = applyTo;
        return this;
    }

    /**
     * 
     * Corresponds to the "definition" property.The definitions to apply to a RabbitMQ operator policy.
     * 
     */
    @JsonProperty("definition")
    public OperatorPolicyDefinition getOperatorPolicyDefinition() {
        return operatorPolicyDefinition;
    }

    /**
     * 
     * Corresponds to the "definition" property.The definitions to apply to a RabbitMQ operator policy.
     * 
     */
    @JsonProperty("definition")
    public void setOperatorPolicyDefinition(OperatorPolicyDefinition operatorPolicyDefinition) {
        this.operatorPolicyDefinition = operatorPolicyDefinition;
    }

    public OperatorPolicy withOperatorPolicyDefinition(OperatorPolicyDefinition operatorPolicyDefinition) {
        this.operatorPolicyDefinition = operatorPolicyDefinition;
        return this;
    }

    /**
     * The policy priority level.
     * 
     */
    @JsonProperty("priority")
    public Long getPriority() {
        return priority;
    }

    /**
     * The policy priority level.
     * 
     */
    @JsonProperty("priority")
    public void setPriority(Long priority) {
        this.priority = priority;
    }

    public OperatorPolicy withPriority(Long priority) {
        this.priority = priority;
        return this;
    }

    @JsonAnyGetter
    public Map getAdditionalProperties() {
        return this.additionalProperties;
    }

    @JsonAnySetter
    public void setAdditionalProperty(String name, Object value) {
        this.additionalProperties.put(name, value);
    }

    public OperatorPolicy withAdditionalProperty(String name, Object value) {
        this.additionalProperties.put(name, value);
        return this;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(OperatorPolicy.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
        sb.append("vhost");
        sb.append('=');
        sb.append(((this.vhost == null)?"":this.vhost));
        sb.append(',');
        sb.append("name");
        sb.append('=');
        sb.append(((this.name == null)?"":this.name));
        sb.append(',');
        sb.append("pattern");
        sb.append('=');
        sb.append(((this.pattern == null)?"":this.pattern));
        sb.append(',');
        sb.append("applyTo");
        sb.append('=');
        sb.append(((this.applyTo == null)?"":this.applyTo));
        sb.append(',');
        sb.append("operatorPolicyDefinition");
        sb.append('=');
        sb.append(((this.operatorPolicyDefinition == null)?"":this.operatorPolicyDefinition));
        sb.append(',');
        sb.append("priority");
        sb.append('=');
        sb.append(((this.priority == null)?"":this.priority));
        sb.append(',');
        sb.append("additionalProperties");
        sb.append('=');
        sb.append(((this.additionalProperties == null)?"":this.additionalProperties));
        sb.append(',');
        if (sb.charAt((sb.length()- 1)) == ',') {
            sb.setCharAt((sb.length()- 1), ']');
        } else {
            sb.append(']');
        }
        return sb.toString();
    }

    @Override
    public int hashCode() {
        int result = 1;
        result = ((result* 31)+((this.vhost == null)? 0 :this.vhost.hashCode()));
        result = ((result* 31)+((this.applyTo == null)? 0 :this.applyTo.hashCode()));
        result = ((result* 31)+((this.operatorPolicyDefinition == null)? 0 :this.operatorPolicyDefinition.hashCode()));
        result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode()));
        result = ((result* 31)+((this.pattern == null)? 0 :this.pattern.hashCode()));
        result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
        result = ((result* 31)+((this.priority == null)? 0 :this.priority.hashCode()));
        return result;
    }

    @Override
    public boolean equals(Object other) {
        if (other == this) {
            return true;
        }
        if ((other instanceof OperatorPolicy) == false) {
            return false;
        }
        OperatorPolicy rhs = ((OperatorPolicy) other);
        return ((((((((this.vhost == rhs.vhost)||((this.vhost!= null)&&this.vhost.equals(rhs.vhost)))&&((this.applyTo == rhs.applyTo)||((this.applyTo!= null)&&this.applyTo.equals(rhs.applyTo))))&&((this.operatorPolicyDefinition == rhs.operatorPolicyDefinition)||((this.operatorPolicyDefinition!= null)&&this.operatorPolicyDefinition.equals(rhs.operatorPolicyDefinition))))&&((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name))))&&((this.pattern == rhs.pattern)||((this.pattern!= null)&&this.pattern.equals(rhs.pattern))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.priority == rhs.priority)||((this.priority!= null)&&this.priority.equals(rhs.priority))));
    }

    public enum ApplyTo {

        QUEUES("queues");
        private final String value;
        private final static Map CONSTANTS = new HashMap();

        static {
            for (OperatorPolicy.ApplyTo c: values()) {
                CONSTANTS.put(c.value, c);
            }
        }

        private ApplyTo(String value) {
            this.value = value;
        }

        @Override
        public String toString() {
            return this.value;
        }

        @JsonValue
        public String value() {
            return this.value;
        }

        @JsonCreator
        public static OperatorPolicy.ApplyTo fromValue(String value) {
            OperatorPolicy.ApplyTo constant = CONSTANTS.get(value);
            if (constant == null) {
                throw new IllegalArgumentException(value);
            } else {
                return constant;
            }
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy