Remove all existing @since annotations
[deliverable/tracecompass.git] / org.eclipse.tracecompass.lttng2.control.ui / src / org / eclipse / tracecompass / internal / lttng2 / control / ui / relayd / LttngRelaydConnectionInfo.java
1 /**********************************************************************
2 * Copyright (c) 2014 Ericsson
3 *
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *
9 * Contributors:
10 * Marc-Andre Laperle - Initial implementation
11 **********************************************************************/
12
13 package org.eclipse.tracecompass.internal.lttng2.control.ui.relayd;
14
15 /**
16 * A class that holds information about the relayd connection.
17 *
18 * @author Marc-Andre Laperle
19 */
20 public final class LttngRelaydConnectionInfo {
21
22 private final String fHost;
23 private final int fPort;
24 private final String fSessionName;
25
26 /**
27 * Constructs a connection information.
28 *
29 * @param host
30 * the host string
31 * @param port
32 * the port number
33 * @param sessionName
34 * the session name
35 */
36 public LttngRelaydConnectionInfo(String host, int port, String sessionName) {
37 fHost = host;
38 fPort = port;
39 fSessionName = sessionName;
40 }
41
42 /**
43 * Get the host string.
44 *
45 * @return the host string
46 */
47 public String getHost() {
48 return fHost;
49 }
50
51 /**
52 * Get the port number.
53 *
54 * @return the port number
55 */
56 public int getPort() {
57 return fPort;
58 }
59
60 /**
61 * Get the session name.
62 *
63 * @return the session name
64 */
65 public String getSessionName() {
66 return fSessionName;
67 }
68
69 @Override
70 public int hashCode() {
71 final int prime = 31;
72 int result = 1;
73 result = prime * result + ((fHost == null) ? 0 : fHost.hashCode());
74 result = prime * result + fPort;
75 result = prime * result + ((fSessionName == null) ? 0 : fSessionName.hashCode());
76 return result;
77 }
78
79 @Override
80 public boolean equals(final Object obj) {
81 if (this == obj) {
82 return true;
83 }
84 if (obj == null) {
85 return false;
86 }
87 if (getClass() != obj.getClass()) {
88 return false;
89 }
90 LttngRelaydConnectionInfo other = (LttngRelaydConnectionInfo) obj;
91 if (fHost == null) {
92 if (other.fHost != null) {
93 return false;
94 }
95 } else if (!fHost.equals(other.fHost)) {
96 return false;
97 }
98 if (fPort != other.fPort) {
99 return false;
100 }
101 if (fSessionName == null) {
102 if (other.fSessionName != null) {
103 return false;
104 }
105 } else if (!fSessionName.equals(other.fSessionName)) {
106 return false;
107 }
108 return true;
109 }
110 }
This page took 0.036304 seconds and 5 git commands to generate.