16 package org.openkilda.messaging.command.flow;
18 import static com.google.common.base.MoreObjects.toStringHelper;
25 import com.fasterxml.jackson.annotation.JsonCreator;
26 import com.fasterxml.jackson.annotation.JsonInclude;
27 import com.fasterxml.jackson.annotation.JsonProperty;
28 import com.fasterxml.jackson.annotation.JsonPropertyOrder;
29 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
31 import java.util.Objects;
38 @JsonInclude(JsonInclude.Include.NON_NULL)
52 private static final long serialVersionUID = 1L;
57 @JsonProperty(
"transit_vlan_id")
58 protected Integer transitVlanId;
74 @JsonProperty(FLOW_ID) final String
id,
75 @JsonProperty("cookie") final Long cookie,
77 @JsonProperty("input_port") final Integer inputPort,
78 @JsonProperty("output_port") final Integer outputPort,
79 @JsonProperty("transit_vlan_id") final Integer transitVlanId) {
80 super(transactionId,
id, cookie, switchId, inputPort, outputPort);
81 setTransitVlanId(transitVlanId);
99 if (transitVlanId == null) {
100 throw new IllegalArgumentException(
"need to set transit_vlan_id");
103 throw new IllegalArgumentException(
"need to set valid value for transit_vlan_id");
105 this.transitVlanId = transitVlanId;
113 return toStringHelper(
this)
114 .add(TRANSACTION_ID, transactionId)
116 .add(
"cookie", cookie)
117 .add(
"switch_id", switchId)
118 .add(
"input_port", inputPort)
119 .add(
"output_port", outputPort)
120 .add(
"transit_vlan_id", transitVlanId)
129 if (
this ==
object) {
132 if (
object == null || getClass() !=
object.getClass()) {
138 && Objects.equals(getId(), that.
getId())
139 && Objects.equals(getCookie(), that.
getCookie())
140 && Objects.equals(getSwitchId(), that.
getSwitchId())
151 return Objects.hash(transactionId,
id, cookie, switchId, inputPort, outputPort, transitVlanId);
static boolean validateVlanRange(final Integer vlanId)
void setTransitVlanId(final Integer transitVlanId)
Integer getTransitVlanId()
boolean equals(Object object)
static final String TRANSACTION_ID
static final String FLOW_ID