16 package org.openkilda.messaging.command.flow;
18 import static com.google.common.base.MoreObjects.toStringHelper;
26 import com.fasterxml.jackson.annotation.JsonCreator;
27 import com.fasterxml.jackson.annotation.JsonInclude;
28 import com.fasterxml.jackson.annotation.JsonProperty;
29 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
30 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
32 import java.util.Objects;
41 @JsonInclude(JsonInclude.Include.NON_NULL)
42 @JsonPropertyOrder(
value = {
57 private static final long serialVersionUID = 1L;
62 @JsonProperty(
"output_vlan_type")
68 @JsonProperty("output_vlan_id")
69 protected Integer outputVlanId;
87 @JsonProperty(FLOW_ID) final String
id,
88 @JsonProperty("cookie") final Long cookie,
90 @JsonProperty("input_port") final Integer inputPort,
91 @JsonProperty("output_port") final Integer outputPort,
92 @JsonProperty("transit_vlan_id") final Integer transitVlanId,
93 @JsonProperty("output_vlan_id") final Integer outputVlanId,
94 @JsonProperty("output_vlan_type") final
OutputVlanType outputVlanType) {
95 super(transactionId,
id, cookie, switchId, inputPort, outputPort, transitVlanId);
96 setOutputVlanId(outputVlanId);
97 setOutputVlanType(outputVlanType);
106 return outputVlanType;
115 if (outputVlanType == null) {
116 throw new IllegalArgumentException(
"need to set output_vlan_type");
118 throw new IllegalArgumentException(
"need to set valid values for output_vlan_id and output_vlan_type");
120 this.outputVlanType = outputVlanType;
139 if (outputVlanId == null) {
140 this.outputVlanId = 0;
142 this.outputVlanId = outputVlanId;
144 throw new IllegalArgumentException(
"need to set valid value for output_vlan_id");
153 return toStringHelper(
this)
154 .add(TRANSACTION_ID, transactionId)
156 .add(
"cookie", cookie)
157 .add(
"switch_id", switchId)
158 .add(
"input_port", inputPort)
159 .add(
"output_port", outputPort)
160 .add(
"transit_vlan_id", transitVlanId)
161 .add(
"output_vlan_id", outputVlanId)
162 .add(
"output_vlan_type", outputVlanType)
171 if (
this ==
object) {
174 if (
object == null || getClass() !=
object.getClass()) {
180 && Objects.equals(getId(), that.
getId())
181 && Objects.equals(getCookie(), that.
getCookie())
182 && Objects.equals(getSwitchId(), that.
getSwitchId())
195 return Objects.hash(transactionId,
id, cookie, switchId, inputPort, outputPort,
196 transitVlanId, outputVlanType, outputVlanId);
void setOutputVlanId(final Integer outputVlanId)
static boolean validateVlanRange(final Integer vlanId)
boolean equals(Object object)
OutputVlanType getOutputVlanType()
Integer getTransitVlanId()
void setOutputVlanType(final OutputVlanType outputVlanType)
static final String TRANSACTION_ID
static boolean validateOutputVlanType(final Integer outputVlanId, final OutputVlanType outputVlanType)
Integer getOutputVlanId()
static final String FLOW_ID