update link to upper-constraints.txt
[dmaap/datarouter.git] / datarouter-prov / src / main / java / org / onap / dmaap / datarouter / provisioning / beans / FeedLinks.java
1 /*******************************************************************************\r
2  * ============LICENSE_START==================================================\r
3  * * org.onap.dmaap\r
4  * * ===========================================================================\r
5  * * Copyright © 2017 AT&T Intellectual Property. All rights reserved.\r
6  * * ===========================================================================\r
7  * * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * * you may not use this file except in compliance with the License.\r
9  * * You may obtain a copy of the License at\r
10  * *\r
11  *  *      http://www.apache.org/licenses/LICENSE-2.0\r
12  * *\r
13  *  * Unless required by applicable law or agreed to in writing, software\r
14  * * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * * See the License for the specific language governing permissions and\r
17  * * limitations under the License.\r
18  * * ============LICENSE_END====================================================\r
19  * *\r
20  * * ECOMP is a trademark and service mark of AT&T Intellectual Property.\r
21  * *\r
22  ******************************************************************************/\r
23 \r
24 \r
25 package org.onap.dmaap.datarouter.provisioning.beans;\r
26 \r
27 import java.util.Objects;\r
28 import org.json.JSONObject;\r
29 \r
30 /**\r
31  * The URLs associated with a Feed.\r
32  *\r
33  * @author Robert Eby\r
34  * @version $Id: FeedLinks.java,v 1.3 2013/07/05 13:48:05 eby Exp $\r
35  */\r
36 \r
37 public class FeedLinks implements JSONable {\r
38     private String self;\r
39     private String publish;\r
40     private String subscribe;\r
41     private String log;\r
42 \r
43     public FeedLinks() {\r
44         self = publish = subscribe = log = null;\r
45     }\r
46 \r
47     /**\r
48      * FeedLinks constructor.\r
49      * @param jo JSONObject\r
50      */\r
51     public FeedLinks(JSONObject jo) {\r
52         this();\r
53         self = jo.getString("self");\r
54         publish = jo.getString("publish");\r
55         subscribe = jo.getString("subscribe");\r
56         log = jo.getString("log");\r
57     }\r
58 \r
59     public String getSelf() {\r
60         return self;\r
61     }\r
62 \r
63     public void setSelf(String self) {\r
64         this.self = self;\r
65     }\r
66 \r
67     public String getPublish() {\r
68         return publish;\r
69     }\r
70 \r
71     public void setPublish(String publish) {\r
72         this.publish = publish;\r
73     }\r
74 \r
75     public String getSubscribe() {\r
76         return subscribe;\r
77     }\r
78 \r
79     public void setSubscribe(String subscribe) {\r
80         this.subscribe = subscribe;\r
81     }\r
82 \r
83     public String getLog() {\r
84         return log;\r
85     }\r
86 \r
87     public void setLog(String log) {\r
88         this.log = log;\r
89     }\r
90 \r
91     @Override\r
92     public JSONObject asJSONObject() {\r
93         JSONObject jo = new JSONObject();\r
94         jo.put("self", self);\r
95         jo.put("publish", publish);\r
96         jo.put("subscribe", subscribe);\r
97         jo.put("log", log);\r
98         return jo;\r
99     }\r
100 \r
101     @Override\r
102     public boolean equals(Object obj) {\r
103         if (!(obj instanceof FeedLinks)) {\r
104             return false;\r
105         }\r
106         FeedLinks of = (FeedLinks) obj;\r
107         if (!self.equals(of.self)) {\r
108             return false;\r
109         }\r
110         if (!publish.equals(of.publish)) {\r
111             return false;\r
112         }\r
113         if (!subscribe.equals(of.subscribe)) {\r
114             return false;\r
115         }\r
116         if (!log.equals(of.log)) {\r
117             return false;\r
118         }\r
119         return true;\r
120     }\r
121 \r
122     @Override\r
123     public int hashCode() {\r
124         return Objects.hash(self, publish, subscribe, log);\r
125     }\r
126 }\r