01: /*
02: * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05:
06: package com.sun.portal.search.rdmserver;
07:
08: /**
09: * Each RDM service defines which combinations of type and query
10: * language it handles. Requests are routed based on this.
11: */
12: public class RDMServiceDescriptor {
13:
14: String type;
15: String ql;
16:
17: /** Creates new RDMServiceDescriptor */
18: public RDMServiceDescriptor(String type, String ql) {
19: this .type = type;
20: this .ql = ql;
21: }
22:
23: public String getRDMType() {
24: return type;
25: }
26:
27: public String getQueryLanguage() {
28: return ql;
29: }
30:
31: public boolean equals(Object o) {
32: RDMServiceDescriptor s = (RDMServiceDescriptor) o;
33: return (type == null && s.type == null || type != null
34: && s.type != null && type.equals(s.type))
35: && (ql == null && s.ql == null || ql != null
36: && s.ql != null && ql.equals(s.ql));
37: }
38:
39: public int hashCode() {
40: int hc = 0;
41: if (type != null)
42: hc += type.hashCode();
43: if (ql != null)
44: hc += ql.hashCode();
45: return hc;
46: }
47:
48: }
|