Debian Codegraph @

src/org/osgi/resource/Wire.java

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
•1 /*
2 * Copyright (c) OSGi Alliance (2011, 2013). All Rights Reserved.
3 *
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 */
16
17 package org.osgi.resource;
18
19 import org.osgi.annotation.versioning.ConsumerType;
20
21 /**
22 * A wire connecting a {@link Capability} to a {@link Requirement}.
23 *
24 * <p>
25 * Instances of this type must be <i>effectively immutable</i>. That is, for a
26 * given instance of this interface, the methods defined by this interface must
27 * always return the same result.
28 *
29 * @ThreadSafe
30 * @author $Id: 6c248ea2b9b24f3610a14e5e8deec9cd0b7aa1c9 $
31 */
32 @ConsumerType
33 public interface Wire {
34 /**
35 * Returns the {@link Capability} for this wire.
36 *
37 * @return The {@link Capability} for this wire.
38 */
39 Capability getCapability();
40
41 /**
42 * Returns the {@link Requirement} for this wire.
43 *
44 * @return The {@link Requirement} for this wire.
45 */
46 Requirement getRequirement();
47
48 /**
49 * Returns the resource providing the {@link #getCapability() capability}.
50 *
51 * <p>
52 * The returned resource may differ from the resource referenced by the
53 * {@link #getCapability() capability}.
54 *
55 * @return The resource providing the capability.
56 */
57 Resource getProvider();
58
59 /**
60 * Returns the resource who {@link #getRequirement() requires} the
61 * {@link #getCapability() capability}.
62 *
63 * <p>
64 * The returned resource may differ from the resource referenced by the
65 * {@link #getRequirement() requirement}.
66 *
67 * @return The resource who requires the capability.
68 */
69 Resource getRequirer();
70
71 /**
72 * Compares this {@code Wire} to another {@code Wire}.
73 *
74 * <p>
75 * This {@code Wire} is equal to another {@code Wire} if they have the same
76 * capability, requirement, provider and requirer.
77 *
78 * @param obj The object to compare against this {@code Wire}.
79 * @return {@code true} if this {@code Wire} is equal to the other object;
80 * {@code false} otherwise.
81 */
82 boolean equals(Object obj);
83
84 /**
85 * Returns the hashCode of this {@code Wire}.
86 *
87 * @return The hashCode of this {@code Wire}.
88 */
89 int hashCode();
90 }