23d06518e44ca58d1ceecbd472bc6e895e3384ad
[msb/discovery.git] / sdclient / discovery-service / src / main / java / org / onap / msb / sdclient / wrapper / consul / model / health / Service.java
1 /**
2  * Copyright 2016-2017 ZTE, Inc. and others.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.onap.msb.sdclient.wrapper.consul.model.health;
17
18 import java.util.List;
19
20 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
21 import com.fasterxml.jackson.annotation.JsonProperty;
22 import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
23 import com.fasterxml.jackson.databind.annotation.JsonSerialize;
24 import com.google.common.collect.ImmutableList;
25
26
27 @JsonSerialize(as = ImmutableService.class)
28 @JsonDeserialize(as = ImmutableService.class)
29 @JsonIgnoreProperties(ignoreUnknown = true)
30 public abstract class Service {
31
32     @JsonProperty("ID")
33     public abstract  String getId();
34
35     @JsonProperty("Service")
36     public abstract  String getService();
37
38     @JsonProperty("Tags")
39     @JsonDeserialize(as = ImmutableList.class, contentAs = String.class)
40     public abstract List<String> getTags();
41     
42     @JsonProperty("Address")
43     public abstract  String getAddress();
44
45     @JsonProperty("Port")
46     public abstract  int getPort();
47 }