Open Kilda Java Documentation
SwitchRulesResponse.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.info.switches;
17 
18 import static com.google.common.base.MoreObjects.toStringHelper;
19 import static java.util.Collections.unmodifiableList;
20 import static org.openkilda.messaging.Utils.TIMESTAMP;
21 
22 import com.fasterxml.jackson.annotation.JsonCreator;
23 import com.fasterxml.jackson.annotation.JsonInclude;
24 import com.fasterxml.jackson.annotation.JsonProperty;
26 
27 import java.util.List;
28 import java.util.Objects;
29 
30 @JsonInclude(JsonInclude.Include.NON_NULL)
31 public class SwitchRulesResponse extends InfoData {
32 
33  @JsonProperty("rule_ids")
34  protected List<Long> ruleIds;
35 
41  @JsonCreator
42  public SwitchRulesResponse(@JsonProperty("rule_ids") List<Long> ruleIds) {
43  this.ruleIds = unmodifiableList(Objects.requireNonNull(ruleIds, "rule_ids must not be null"));
44  }
45 
46  public List<Long> getRuleIds() {
47  return ruleIds;
48  }
49 
50  @Override
51  public String toString() {
52  return toStringHelper(this)
53  .add(TIMESTAMP, timestamp)
54  .add("rule_ids", ruleIds)
55  .toString();
56  }
57 }
static final String TIMESTAMP
Definition: Utils.java:35