Open Kilda Java Documentation
LinkProps.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.model;
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 import java.util.Map;
25 
26 @Value
27 public class LinkProps implements Serializable {
28  @JsonProperty("source")
29  private NetworkEndpoint source;
30 
31  @JsonProperty("dest")
32  private NetworkEndpoint dest;
33 
34  @JsonProperty("props")
35  private Map<String, String> props;
36 
37  @JsonProperty("time_create")
38  private Long created;
39 
40  @JsonProperty("time_modify")
41  private Long modified;
42 
43  @Builder
44  @JsonCreator
45  public LinkProps(
46  @JsonProperty("source") NetworkEndpoint source,
47  @JsonProperty("dest") NetworkEndpoint dest,
48  @JsonProperty("props") Map<String, String> props,
49  @JsonProperty("time_create") Long created,
50  @JsonProperty("time_modify") Long modified) {
51  this.source = source;
52  this.dest = dest;
53  this.props = props;
54  this.created = created;
55  this.modified = modified;
56  }
57 
58  public LinkProps(NetworkEndpoint source, NetworkEndpoint dest, Map<String, String> props) {
59  this.source = source;
60  this.dest = dest;
61  this.props = props;
62  this.created = null;
63  this.modified = null;
64  }
65 }