Open Kilda Java Documentation
DeleteRulesCriteria.java
Go to the documentation of this file.
1 /* Copyright 2018 Telstra Open Source
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 package org.openkilda.messaging.command.switches;
17 
18 import com.fasterxml.jackson.annotation.JsonCreator;
19 import com.fasterxml.jackson.annotation.JsonProperty;
20 import lombok.Builder;
21 import lombok.Value;
22 
23 import java.io.Serializable;
24 
28 @Value
29 @Builder
30 public class DeleteRulesCriteria implements Serializable {
31 
32  private static final long serialVersionUID = 1L;
33 
34  @JsonProperty("cookie")
35  Long cookie;
36 
37  @JsonProperty("in_port")
38  Integer inPort;
39  @JsonProperty("in_vlan")
40  Integer inVlan;
41 
42  @JsonProperty("priority")
43  Integer priority;
44 
45  @JsonProperty("out_port")
46  Integer outPort;
47 
48  @JsonCreator
50  @JsonProperty("cookie") Long cookie,
51  @JsonProperty("in_port") Integer inPort,
52  @JsonProperty("in_vlan") Integer inVlan,
53  @JsonProperty("priority") Integer priority,
54  @JsonProperty("out_port") Integer outPort) {
55  if ((cookie == null || cookie == 0)
56  && (inPort == null || inPort == 0)
57  && (inVlan == null || inVlan == 0)
58  && (priority == null || priority == 0)
59  && (outPort == null || outPort == 0)) {
60  throw new IllegalArgumentException("DeleteRulesCriteria can't be constructed empty.");
61  }
62 
63  this.cookie = cookie;
64  this.inPort = inPort;
65  this.inVlan = inVlan;
66  this.priority = priority;
67  this.outPort = outPort;
68  }
69 }
70 
DeleteRulesCriteria( @JsonProperty("cookie") Long cookie, @JsonProperty("in_port") Integer inPort, @JsonProperty("in_vlan") Integer inVlan, @JsonProperty("priority") Integer priority, @JsonProperty("out_port") Integer outPort)