
com.indeed.rabbitmq.admin.pojo.OperatorPolicyDefinition Maven / Gradle / Ivy
package com.indeed.rabbitmq.admin.pojo;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
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;
/**
* The definitions to apply to a RabbitMQ operator policy.
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"expires",
"max-length",
"max-length-bytes",
"message-ttl"
})
public class OperatorPolicyDefinition {
/**
* Remove queue if it remains unused for this number of milliseconds.
*
*/
@JsonProperty("expires")
@JsonPropertyDescription("Remove queue if it remains unused for this number of milliseconds.")
private Long expires;
/**
* Maximum number of messages in a queue.
*
*/
@JsonProperty("max-length")
@JsonPropertyDescription("Maximum number of messages in a queue.")
private Long maxLength;
/**
* Maximum number of bytes in a queue.
*
*/
@JsonProperty("max-length-bytes")
@JsonPropertyDescription("Maximum number of bytes in a queue.")
private Long maxLengthBytes;
/**
* Remove message if it remains in the queue for this number of milliseconds.
*
* Sets the TTL on messages in a queue. Policy must be attached to a queue.
* These messages are routed as dead letter messages after expiration.
*
*/
@JsonProperty("message-ttl")
@JsonPropertyDescription("Sets the TTL on messages in a queue. Policy must be attached to a queue.\nThese messages are routed as dead letter messages after expiration.")
private Long messageTtl;
@JsonIgnore
private Map additionalProperties = new HashMap();
/**
* Remove queue if it remains unused for this number of milliseconds.
*
*/
@JsonProperty("expires")
public Long getExpires() {
return expires;
}
/**
* Remove queue if it remains unused for this number of milliseconds.
*
*/
@JsonProperty("expires")
public void setExpires(Long expires) {
this.expires = expires;
}
public OperatorPolicyDefinition withExpires(Long expires) {
this.expires = expires;
return this;
}
/**
* Maximum number of messages in a queue.
*
*/
@JsonProperty("max-length")
public Long getMaxLength() {
return maxLength;
}
/**
* Maximum number of messages in a queue.
*
*/
@JsonProperty("max-length")
public void setMaxLength(Long maxLength) {
this.maxLength = maxLength;
}
public OperatorPolicyDefinition withMaxLength(Long maxLength) {
this.maxLength = maxLength;
return this;
}
/**
* Maximum number of bytes in a queue.
*
*/
@JsonProperty("max-length-bytes")
public Long getMaxLengthBytes() {
return maxLengthBytes;
}
/**
* Maximum number of bytes in a queue.
*
*/
@JsonProperty("max-length-bytes")
public void setMaxLengthBytes(Long maxLengthBytes) {
this.maxLengthBytes = maxLengthBytes;
}
public OperatorPolicyDefinition withMaxLengthBytes(Long maxLengthBytes) {
this.maxLengthBytes = maxLengthBytes;
return this;
}
/**
* Remove message if it remains in the queue for this number of milliseconds.
*
* Sets the TTL on messages in a queue. Policy must be attached to a queue.
* These messages are routed as dead letter messages after expiration.
*
*/
@JsonProperty("message-ttl")
public Long getMessageTtl() {
return messageTtl;
}
/**
* Remove message if it remains in the queue for this number of milliseconds.
*
* Sets the TTL on messages in a queue. Policy must be attached to a queue.
* These messages are routed as dead letter messages after expiration.
*
*/
@JsonProperty("message-ttl")
public void setMessageTtl(Long messageTtl) {
this.messageTtl = messageTtl;
}
public OperatorPolicyDefinition withMessageTtl(Long messageTtl) {
this.messageTtl = messageTtl;
return this;
}
@JsonAnyGetter
public Map getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public OperatorPolicyDefinition withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(OperatorPolicyDefinition.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("expires");
sb.append('=');
sb.append(((this.expires == null)?"":this.expires));
sb.append(',');
sb.append("maxLength");
sb.append('=');
sb.append(((this.maxLength == null)?"":this.maxLength));
sb.append(',');
sb.append("maxLengthBytes");
sb.append('=');
sb.append(((this.maxLengthBytes == null)?"":this.maxLengthBytes));
sb.append(',');
sb.append("messageTtl");
sb.append('=');
sb.append(((this.messageTtl == null)?"":this.messageTtl));
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.expires == null)? 0 :this.expires.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.messageTtl == null)? 0 :this.messageTtl.hashCode()));
result = ((result* 31)+((this.maxLength == null)? 0 :this.maxLength.hashCode()));
result = ((result* 31)+((this.maxLengthBytes == null)? 0 :this.maxLengthBytes.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof OperatorPolicyDefinition) == false) {
return false;
}
OperatorPolicyDefinition rhs = ((OperatorPolicyDefinition) other);
return ((((((this.expires == rhs.expires)||((this.expires!= null)&&this.expires.equals(rhs.expires)))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.messageTtl == rhs.messageTtl)||((this.messageTtl!= null)&&this.messageTtl.equals(rhs.messageTtl))))&&((this.maxLength == rhs.maxLength)||((this.maxLength!= null)&&this.maxLength.equals(rhs.maxLength))))&&((this.maxLengthBytes == rhs.maxLengthBytes)||((this.maxLengthBytes!= null)&&this.maxLengthBytes.equals(rhs.maxLengthBytes))));
}
}