Update project structure to org.onap
[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.io.InvalidObjectException;\r
28 \r
29 import org.json.JSONObject;\r
30 \r
31 /**\r
32  * The URLs associated with a Feed.\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 public class FeedLinks implements JSONable {\r
37         private String self;\r
38         private String publish;\r
39         private String subscribe;\r
40         private String log;\r
41 \r
42         public FeedLinks() {\r
43                 self = publish = subscribe = log = null;\r
44         }\r
45 \r
46         public FeedLinks(JSONObject jo) throws InvalidObjectException {\r
47                 this();\r
48                 self      = jo.getString("self");\r
49                 publish   = jo.getString("publish");\r
50                 subscribe = jo.getString("subscribe");\r
51                 log       = jo.getString("log");\r
52         }\r
53 \r
54         public String getSelf() {\r
55                 return self;\r
56         }\r
57         public void setSelf(String self) {\r
58                 this.self = self;\r
59         }\r
60         public String getPublish() {\r
61                 return publish;\r
62         }\r
63         public void setPublish(String publish) {\r
64                 this.publish = publish;\r
65         }\r
66         public String getSubscribe() {\r
67                 return subscribe;\r
68         }\r
69         public void setSubscribe(String subscribe) {\r
70                 this.subscribe = subscribe;\r
71         }\r
72         public String getLog() {\r
73                 return log;\r
74         }\r
75         public void setLog(String log) {\r
76                 this.log = log;\r
77         }\r
78 \r
79         @Override\r
80         public JSONObject asJSONObject() {\r
81                 JSONObject jo = new JSONObject();\r
82                 jo.put("self", self);\r
83                 jo.put("publish", publish);\r
84                 jo.put("subscribe", subscribe);\r
85                 jo.put("log", log);\r
86                 return jo;\r
87         }\r
88         @Override\r
89         public boolean equals(Object obj) {\r
90                 if (!(obj instanceof FeedLinks))\r
91                         return false;\r
92                 FeedLinks of = (FeedLinks) obj;\r
93                 if (!self.equals(of.self))\r
94                         return false;\r
95                 if (!publish.equals(of.publish))\r
96                         return false;\r
97                 if (!subscribe.equals(of.subscribe))\r
98                         return false;\r
99                 if (!log.equals(of.log))\r
100                         return false;\r
101                 return true;\r
102         }\r
103 }\r