Divide the MSB source codes into two repos
[msb/apigateway.git] / apiroute / apiroute-service / src / main / java / org / onap / msb / apiroute / wrapper / consulextend / model / health / Service.java
diff --git a/apiroute/apiroute-service/src/main/java/org/onap/msb/apiroute/wrapper/consulextend/model/health/Service.java b/apiroute/apiroute-service/src/main/java/org/onap/msb/apiroute/wrapper/consulextend/model/health/Service.java
new file mode 100644 (file)
index 0000000..fd7f3fa
--- /dev/null
@@ -0,0 +1,39 @@
+package org.onap.msb.apiroute.wrapper.consulextend.model.health;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
+import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+import com.google.common.collect.ImmutableList;
+import org.immutables.value.Value;
+
+import java.util.List;
+
+@Value.Immutable
+@JsonSerialize(as = ImmutableService.class)
+@JsonDeserialize(as = ImmutableService.class)
+@JsonIgnoreProperties(ignoreUnknown = true)
+public abstract class Service {
+
+       @JsonProperty("ID")
+       public abstract String getId();
+
+       @JsonProperty("Service")
+       public abstract String getService();
+
+       @JsonProperty("Tags")
+       @JsonDeserialize(as = ImmutableList.class, contentAs = String.class)
+       public abstract List<String> getTags();
+
+       @JsonProperty("Address")
+       public abstract String getAddress();
+
+       @JsonProperty("Port")
+       public abstract int getPort();
+
+       @JsonProperty("CreateIndex")
+       public abstract int getCreateIndex();
+
+       @JsonProperty("ModifyIndex")
+       public abstract int getModifyIndex();
+}