
com.indeed.rabbitmq.admin.pojo.Binding 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.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 an existing exchange-to-exchange or exchange-to-queue binding.
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"source",
"vhost",
"destination",
"destination_type",
"routing_key",
"arguments",
"properties_key"
})
public class Binding {
/**
* The name of the source from which messages are routed.
* Will be the name of an exchange.
*
*/
@JsonProperty("source")
@JsonPropertyDescription("The name of the source from which messages are routed.\nWill be the name of an exchange.")
private java.lang.String source;
/**
* The virtual host to which this binding belongs.
*
*/
@JsonProperty("vhost")
@JsonPropertyDescription("The virtual host to which this binding belongs.")
private java.lang.String vhost;
/**
* The name of the destination to which messages are routed.
* May be the name of an exchange or a queue.
*
*/
@JsonProperty("destination")
@JsonPropertyDescription("The name of the destination to which messages are routed.\nMay be the name of an exchange or a queue.")
private java.lang.String destination;
/**
* The RabbitMQ entity type of the destination.
*
*/
@JsonProperty("destination_type")
@JsonPropertyDescription("The RabbitMQ entity type of the destination.")
private Binding.DestinationType destinationType;
/**
* The binding key to match against the message routing key to determine if this binding takes effect.
*
*/
@JsonProperty("routing_key")
@JsonPropertyDescription("The binding key to match against the message routing key to determine if this binding takes effect.")
private java.lang.String routingKey;
/**
* Additional arguments that may apply to this binding.
*
*/
@JsonProperty("arguments")
@JsonPropertyDescription("Additional arguments that may apply to this binding.")
private Map arguments;
/**
* The properties key used to uniquely identify this binding for API calls.
*
*/
@JsonProperty("properties_key")
@JsonPropertyDescription("The properties key used to uniquely identify this binding for API calls.")
private java.lang.String propertiesKey;
@JsonIgnore
private Map additionalProperties = new HashMap();
/**
* The name of the source from which messages are routed.
* Will be the name of an exchange.
*
*/
@JsonProperty("source")
public java.lang.String getSource() {
return source;
}
/**
* The name of the source from which messages are routed.
* Will be the name of an exchange.
*
*/
@JsonProperty("source")
public void setSource(java.lang.String source) {
this.source = source;
}
public Binding withSource(java.lang.String source) {
this.source = source;
return this;
}
/**
* The virtual host to which this binding belongs.
*
*/
@JsonProperty("vhost")
public java.lang.String getVhost() {
return vhost;
}
/**
* The virtual host to which this binding belongs.
*
*/
@JsonProperty("vhost")
public void setVhost(java.lang.String vhost) {
this.vhost = vhost;
}
public Binding withVhost(java.lang.String vhost) {
this.vhost = vhost;
return this;
}
/**
* The name of the destination to which messages are routed.
* May be the name of an exchange or a queue.
*
*/
@JsonProperty("destination")
public java.lang.String getDestination() {
return destination;
}
/**
* The name of the destination to which messages are routed.
* May be the name of an exchange or a queue.
*
*/
@JsonProperty("destination")
public void setDestination(java.lang.String destination) {
this.destination = destination;
}
public Binding withDestination(java.lang.String destination) {
this.destination = destination;
return this;
}
/**
* The RabbitMQ entity type of the destination.
*
*/
@JsonProperty("destination_type")
public Binding.DestinationType getDestinationType() {
return destinationType;
}
/**
* The RabbitMQ entity type of the destination.
*
*/
@JsonProperty("destination_type")
public void setDestinationType(Binding.DestinationType destinationType) {
this.destinationType = destinationType;
}
public Binding withDestinationType(Binding.DestinationType destinationType) {
this.destinationType = destinationType;
return this;
}
/**
* The binding key to match against the message routing key to determine if this binding takes effect.
*
*/
@JsonProperty("routing_key")
public java.lang.String getRoutingKey() {
return routingKey;
}
/**
* The binding key to match against the message routing key to determine if this binding takes effect.
*
*/
@JsonProperty("routing_key")
public void setRoutingKey(java.lang.String routingKey) {
this.routingKey = routingKey;
}
public Binding withRoutingKey(java.lang.String routingKey) {
this.routingKey = routingKey;
return this;
}
/**
* Additional arguments that may apply to this binding.
*
*/
@JsonProperty("arguments")
public Map getArguments() {
return arguments;
}
/**
* Additional arguments that may apply to this binding.
*
*/
@JsonProperty("arguments")
public void setArguments(Map arguments) {
this.arguments = arguments;
}
public Binding withArguments(Map arguments) {
this.arguments = arguments;
return this;
}
/**
* The properties key used to uniquely identify this binding for API calls.
*
*/
@JsonProperty("properties_key")
public java.lang.String getPropertiesKey() {
return propertiesKey;
}
/**
* The properties key used to uniquely identify this binding for API calls.
*
*/
@JsonProperty("properties_key")
public void setPropertiesKey(java.lang.String propertiesKey) {
this.propertiesKey = propertiesKey;
}
public Binding withPropertiesKey(java.lang.String propertiesKey) {
this.propertiesKey = propertiesKey;
return this;
}
@JsonAnyGetter
public Map getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(java.lang.String name, java.lang.Object value) {
this.additionalProperties.put(name, value);
}
public Binding withAdditionalProperty(java.lang.String name, java.lang.Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public java.lang.String toString() {
StringBuilder sb = new StringBuilder();
sb.append(Binding.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("source");
sb.append('=');
sb.append(((this.source == null)?"":this.source));
sb.append(',');
sb.append("vhost");
sb.append('=');
sb.append(((this.vhost == null)?"":this.vhost));
sb.append(',');
sb.append("destination");
sb.append('=');
sb.append(((this.destination == null)?"":this.destination));
sb.append(',');
sb.append("destinationType");
sb.append('=');
sb.append(((this.destinationType == null)?"":this.destinationType));
sb.append(',');
sb.append("routingKey");
sb.append('=');
sb.append(((this.routingKey == null)?"":this.routingKey));
sb.append(',');
sb.append("arguments");
sb.append('=');
sb.append(((this.arguments == null)?"":this.arguments));
sb.append(',');
sb.append("propertiesKey");
sb.append('=');
sb.append(((this.propertiesKey == null)?"":this.propertiesKey));
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.destination == null)? 0 :this.destination.hashCode()));
result = ((result* 31)+((this.destinationType == null)? 0 :this.destinationType.hashCode()));
result = ((result* 31)+((this.arguments == null)? 0 :this.arguments.hashCode()));
result = ((result* 31)+((this.source == null)? 0 :this.source.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.routingKey == null)? 0 :this.routingKey.hashCode()));
result = ((result* 31)+((this.propertiesKey == null)? 0 :this.propertiesKey.hashCode()));
return result;
}
@Override
public boolean equals(java.lang.Object other) {
if (other == this) {
return true;
}
if ((other instanceof Binding) == false) {
return false;
}
Binding rhs = ((Binding) other);
return (((((((((this.vhost == rhs.vhost)||((this.vhost!= null)&&this.vhost.equals(rhs.vhost)))&&((this.destination == rhs.destination)||((this.destination!= null)&&this.destination.equals(rhs.destination))))&&((this.destinationType == rhs.destinationType)||((this.destinationType!= null)&&this.destinationType.equals(rhs.destinationType))))&&((this.arguments == rhs.arguments)||((this.arguments!= null)&&this.arguments.equals(rhs.arguments))))&&((this.source == rhs.source)||((this.source!= null)&&this.source.equals(rhs.source))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.routingKey == rhs.routingKey)||((this.routingKey!= null)&&this.routingKey.equals(rhs.routingKey))))&&((this.propertiesKey == rhs.propertiesKey)||((this.propertiesKey!= null)&&this.propertiesKey.equals(rhs.propertiesKey))));
}
public enum DestinationType {
EXCHANGE("exchange"),
QUEUE("queue");
private final java.lang.String value;
private final static Map CONSTANTS = new HashMap();
static {
for (Binding.DestinationType c: values()) {
CONSTANTS.put(c.value, c);
}
}
private DestinationType(java.lang.String value) {
this.value = value;
}
@Override
public java.lang.String toString() {
return this.value;
}
@JsonValue
public java.lang.String value() {
return this.value;
}
@JsonCreator
public static Binding.DestinationType fromValue(java.lang.String value) {
Binding.DestinationType constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy