source: trunk/autoquest-plugin-http/src/main/java/de/ugoe/cs/autoquest/plugin/http/eventcore/HTTPTarget.java @ 1367

Last change on this file since 1367 was 1367, checked in by pharms, 10 years ago

Initial import.

File size: 2.2 KB
Line 
1//   Copyright 2012 Georg-August-Universität Göttingen, Germany
2//
3//   Licensed under the Apache License, Version 2.0 (the "License");
4//   you may not use this file except in compliance with the License.
5//   You may obtain a copy of the License at
6//
7//       http://www.apache.org/licenses/LICENSE-2.0
8//
9//   Unless required by applicable law or agreed to in writing, software
10//   distributed under the License is distributed on an "AS IS" BASIS,
11//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//   See the License for the specific language governing permissions and
13//   limitations under the License.
14
15package de.ugoe.cs.autoquest.plugin.http.eventcore;
16
17import de.ugoe.cs.autoquest.eventcore.IEventTarget;
18import de.ugoe.cs.autoquest.httpmonitor.exchange.Address;
19import de.ugoe.cs.autoquest.plugin.http.HTTPUtils;
20
21/**
22 * <p>
23 * TODO comment
24 * </p>
25 *
26 * @author Patrick Harms
27 */
28public class HTTPTarget implements IEventTarget {
29
30    /**  */
31    private static final long serialVersionUID = 1L;
32   
33    /** */
34    private Address receiver;
35
36    /** */
37    private String stringIdentifier;
38
39    /**
40     *
41     */
42    public HTTPTarget(Address receiver) {
43        this.receiver = receiver;
44        this.stringIdentifier = HTTPUtils.toString(this.receiver);
45    }
46
47    /* (non-Javadoc)
48     * @see de.ugoe.cs.autoquest.eventcore.IEventTarget#getPlatform()
49     */
50    @Override
51    public String getPlatform() {
52        return "HTTP";
53    }
54
55    /* (non-Javadoc)
56     * @see de.ugoe.cs.autoquest.eventcore.IEventTarget#getStringIdentifier()
57     */
58    @Override
59    public String getStringIdentifier() {
60        return stringIdentifier;
61    }
62
63    /* (non-Javadoc)
64     * @see java.lang.Object#equals(java.lang.Object)
65     */
66    @Override
67    public boolean equals(Object obj) {
68        if (obj == this) {
69            return true;
70        }
71        else if (obj instanceof HTTPTarget) {
72            return stringIdentifier.equals(((HTTPTarget) obj).stringIdentifier);
73        }
74        else {
75            return false;
76        }
77    }
78
79    /* (non-Javadoc)
80     * @see java.lang.Object#hashCode()
81     */
82    @Override
83    public int hashCode() {
84        return stringIdentifier.hashCode();
85    }
86
87}
Note: See TracBrowser for help on using the repository browser.