Skip to main content

This CGIT instance is deprecated, and repositories have been moved to Gitlab or Github. See the repository descriptions for specific locations.

summaryrefslogtreecommitdiffstats
blob: 25b44417c636ead082342531e329e4ddd341bc78 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*******************************************************************************
 * Copyright (c) 2004, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 * IBM Corporation - initial API and implementation
 * yyyymmdd bug      Email and other contact information
 * -------- -------- -----------------------------------------------------------
 * 20060413   135581 rsinha@ca.ibm.com - Rupam Kuehner
 *******************************************************************************/
/**
 */
package org.eclipse.jst.ws.internal.data;

public class TypeRuntimeServer
{
  private String typeId_     = "";
  private String runtimeId_  = "";
  private String serverId_   = "";
  private String serverInstanceId_;
  
  /**
   * @return Returns the runtimeId_.
   */
  public String getRuntimeId()
  {
    return runtimeId_;
  }
  /**
   * @param runtimeId_ The runtimeId_ to set.
   */
  public void setRuntimeId(String runtimeId_)
  {
    this.runtimeId_ = runtimeId_;
  }
  /**
   * @return Returns the serverId_.
   */
  public String getServerId()
  {
    return serverId_;
  }
  /**
   * @param serverId_ The serverId_ to set.
   */
  public void setServerId(String serverId_)
  {
    this.serverId_ = serverId_;
  }
  /**
   * @return Returns the serverInstanceId_.
   */
  public String getServerInstanceId()
  {
    return serverInstanceId_;
  }
  /**
   * @param serverInstanceId_ The serverInstanceId_ to set.
   */
  public void setServerInstanceId(String serverInstanceId_)
  {
    this.serverInstanceId_ = serverInstanceId_;
  }
  /**
   * @return Returns the typeId_.
   */
  public String getTypeId()
  {
    return typeId_;
  }
  /**
   * @param typeId_ The typeId_ to set.
   */
  public void setTypeId(String typeId_)
  {
    this.typeId_ = typeId_;
  }
  
  /* (non-Javadoc)
   * @see java.lang.Object#toString()
   */
  public String toString()
  {
    return "type(" + typeId_ + ") runtime(" + runtimeId_ + ") factory(" + serverId_ + ") servInstId(" + serverInstanceId_ + ")";
  }
  
  public boolean equals(Object object)
  {
	if (object != null && object instanceof TypeRuntimeServer)
	{
		TypeRuntimeServer trs = (TypeRuntimeServer)object;
		String trsTypeId = trs.getTypeId();
		String trsRuntimeId = trs.getRuntimeId();
		String trsServerId = trs.getServerId();
		String trsServerInstanceId = trs.getServerInstanceId();
		
		boolean typeIdsMatch = ((typeId_ == null) && (trsTypeId == null)) || ((typeId_ != null) && (typeId_.equals(trsTypeId)));
		if (!typeIdsMatch) return false;
		boolean runtimeIdsMatch = ((runtimeId_ == null) && (trsRuntimeId == null)) || ((runtimeId_ != null) && (runtimeId_.equals(trsRuntimeId)));
		if (!runtimeIdsMatch) return false;
		boolean serverIdsMatch = ((serverId_ == null) && (trsServerId == null)) || ((serverId_ != null) && (serverId_.equals(trsServerId)));
		if (!serverIdsMatch) return false;
		boolean serverInstanceIdsMatch = ((serverInstanceId_ == null) && (trsServerInstanceId == null)) || ((serverInstanceId_ != null) && (serverInstanceId_.equals(trsServerInstanceId)));
		if (!serverInstanceIdsMatch) return false;
		
		return true;		
	}
	
	return false;
  }
}

Back to the top