Open Kilda Java Documentation
FlowCacheSyncRequest.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.flow;
17 
18 import static com.google.common.base.MoreObjects.toStringHelper;
19 
20 import com.fasterxml.jackson.annotation.JsonCreator;
21 import com.fasterxml.jackson.annotation.JsonInclude;
22 import com.fasterxml.jackson.annotation.JsonProperty;
23 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
25 
26 import java.util.Objects;
27 
31 @JsonSerialize
32 @JsonInclude(JsonInclude.Include.NON_NULL)
33 public class FlowCacheSyncRequest extends CommandData {
37  private static final long serialVersionUID = 1L;
38 
39  @JsonProperty("sync_cache")
40  private SynchronizeCacheAction synchronizeCache;
41 
47  @JsonCreator
49  @JsonProperty("sync_cache") SynchronizeCacheAction synchronizeCache) {
50  this.synchronizeCache = Objects.requireNonNull(synchronizeCache, "sync_cache must not be null");
51  }
52 
54  return synchronizeCache;
55  }
56 
60  @Override
61  public String toString() {
62  return toStringHelper(this).toString();
63  }
64 
68  @Override
69  public int hashCode() {
70  return super.hashCode();
71  }
72 
76  @Override
77  public boolean equals(Object object) {
78  if (this == object) {
79  return true;
80  }
81  if (object == null || getClass() != object.getClass()) {
82  return false;
83  }
84  return true;
85  }
86 }
FlowCacheSyncRequest( @JsonProperty("sync_cache") SynchronizeCacheAction synchronizeCache)