1 /*******************************************************************************
\r
2 * ============LICENSE_START==================================================
\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
11 * * http://www.apache.org/licenses/LICENSE-2.0
\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
20 * * ECOMP is a trademark and service mark of AT&T Intellectual Property.
\r
22 ******************************************************************************/
\r
25 package org.onap.dmaap.datarouter.provisioning.beans;
\r
27 import java.io.InvalidObjectException;
\r
28 import java.util.Objects;
\r
30 import org.json.JSONObject;
\r
33 * The URLs associated with a Feed.
\r
35 * @author Robert Eby
\r
36 * @version $Id: FeedLinks.java,v 1.3 2013/07/05 13:48:05 eby Exp $
\r
38 public class FeedLinks implements JSONable {
\r
39 private String self;
\r
40 private String publish;
\r
41 private String subscribe;
\r
44 public FeedLinks() {
\r
45 self = publish = subscribe = log = null;
\r
48 public FeedLinks(JSONObject jo) throws InvalidObjectException {
\r
50 self = jo.getString("self");
\r
51 publish = jo.getString("publish");
\r
52 subscribe = jo.getString("subscribe");
\r
53 log = jo.getString("log");
\r
56 public String getSelf() {
\r
60 public void setSelf(String self) {
\r
64 public String getPublish() {
\r
68 public void setPublish(String publish) {
\r
69 this.publish = publish;
\r
72 public String getSubscribe() {
\r
76 public void setSubscribe(String subscribe) {
\r
77 this.subscribe = subscribe;
\r
80 public String getLog() {
\r
84 public void setLog(String log) {
\r
89 public JSONObject asJSONObject() {
\r
90 JSONObject jo = new JSONObject();
\r
91 jo.put("self", self);
\r
92 jo.put("publish", publish);
\r
93 jo.put("subscribe", subscribe);
\r
99 public boolean equals(Object obj) {
\r
100 if (!(obj instanceof FeedLinks))
\r
102 FeedLinks of = (FeedLinks) obj;
\r
103 if (!self.equals(of.self))
\r
105 if (!publish.equals(of.publish))
\r
107 if (!subscribe.equals(of.subscribe))
\r
109 if (!log.equals(of.log))
\r
115 public int hashCode() {
\r
116 return Objects.hash(self, publish, subscribe, log);
\r