blob: cd59905d12aa1c0b9ba82ba1e006976e79e9b1e1 [file] [log] [blame]
ADARA Networks1fb1eb12016-09-01 12:04:07 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
ADARA Networks1fb1eb12016-09-01 12:04:07 -07003 *
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 */
16package org.onosproject.rabbitmq.impl;
17
18/**
19 * Represents the URL pointing to MQ Server. Used to connect to MQ Server.
20 */
21public class BrokerHost {
22
23 private final String url;
24
25 /**
26 * Sets the MQ Server URL.
27 *
28 * @param url represents url of the MQ Server
29 */
30 public BrokerHost(String url) {
31 this.url = url;
32 }
33
34 /**
35 * Returns the MQ Server URL.
36 *
37 * @return url of the MQ Server
38 */
39 public String getUrl() {
40 return url;
41 }
42
43 @Override
44 public boolean equals(Object o) {
45 if (this == o) {
46 return true;
47 }
48
49 if (o == null || getClass() != o.getClass()) {
50 return false;
51 }
52
53 BrokerHost that = (BrokerHost) o;
54
55 return url != null ? url.equals(that.url) : that.url == null;
56 }
57
58 @Override
59 public int hashCode() {
60 return url != null ? url.hashCode() : 0;
61 }
62
63 @Override
64 public String toString() {
65 return url;
66 }
67}