Debian Codegraph @

src/main/java/io/reactivex/rxjava3/disposables/DisposableContainer.java

raw
1 /*
2 * Copyright (c) 2016-present, RxJava Contributors.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
5 * compliance with the License. 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 distributed under the License is
10 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
11 * the License for the specific language governing permissions and limitations under the License.
12 */
13
14 package io.reactivex.rxjava3.disposables;
15
16 /**
17 * Common interface to add and remove disposables from a container.
18 * @since 2.0
19 */
20 public interface DisposableContainer {
21
22 /**
23 * Adds a disposable to this container or disposes it if the
24 * container has been disposed.
25 * @param d the disposable to add, not null
26 * @return true if successful, false if this container has been disposed
27 */
28 boolean add(Disposable d);
29
30 /**
31 * Removes and disposes the given disposable if it is part of this
32 * container.
33 * @param d the disposable to remove and dispose, not null
34 * @return true if the operation was successful
35 */
36 boolean remove(Disposable d);
37
38 /**
39 * Removes but does not dispose the given disposable if it is part of this
40 * container.
41 * @param d the disposable to remove, not null
42 * @return true if the operation was successful
43 */
44 boolean delete(Disposable d);
45 }