Skip to content

Commit 9544c6a

Browse files
committed
Added experimental annotations
1 parent b73a202 commit 9544c6a

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

src/main/java/rx/subjects/AsyncSubject.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.List;
2020

2121
import rx.Observer;
22+
import rx.annotations.Experimental;
2223
import rx.exceptions.CompositeException;
2324
import rx.exceptions.Exceptions;
2425
import rx.functions.Action1;
@@ -147,6 +148,7 @@ public boolean hasObservers() {
147148
* retrieved by {@code getValue()} may get outdated.
148149
* @return true if and only if the subject has some value but not an error
149150
*/
151+
@Experimental
150152
public boolean hasValue() {
151153
Object v = lastValue;
152154
Object o = state.get();
@@ -156,6 +158,7 @@ public boolean hasValue() {
156158
* Check if the Subject has terminated with an exception.
157159
* @return true if the subject has received a throwable through {@code onError}.
158160
*/
161+
@Experimental
159162
public boolean hasThrowable() {
160163
Object o = state.get();
161164
return nl.isError(o);
@@ -164,6 +167,7 @@ public boolean hasThrowable() {
164167
* Check if the Subject has terminated normally.
165168
* @return true if the subject completed normally via {@code onCompleted()}
166169
*/
170+
@Experimental
167171
public boolean hasCompleted() {
168172
Object o = state.get();
169173
return o != null && !nl.isError(o);
@@ -177,6 +181,7 @@ public boolean hasCompleted() {
177181
* @return the current value or {@code null} if the Subject doesn't have a value,
178182
* has terminated with an exception or has an actual {@code null} as a value.
179183
*/
184+
@Experimental
180185
public T getValue() {
181186
Object v = lastValue;
182187
Object o = state.get();
@@ -190,6 +195,7 @@ public T getValue() {
190195
* @return the Throwable that terminated the Subject or {@code null} if the
191196
* subject hasn't terminated yet or it terminated normally.
192197
*/
198+
@Experimental
193199
public Throwable getThrowable() {
194200
Object o = state.get();
195201
if (nl.isError(o)) {

src/main/java/rx/subjects/BehaviorSubject.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.util.List;
2121

2222
import rx.Observer;
23+
import rx.annotations.Experimental;
2324
import rx.exceptions.CompositeException;
2425
import rx.exceptions.Exceptions;
2526
import rx.functions.Action1;
@@ -183,6 +184,7 @@ public boolean hasObservers() {
183184
* retrieved by {@code getValue()} may get outdated.
184185
* @return true if and only if the subject has some value and hasn't terminated yet.
185186
*/
187+
@Experimental
186188
public boolean hasValue() {
187189
Object o = state.get();
188190
return nl.isNext(o);
@@ -191,6 +193,7 @@ public boolean hasValue() {
191193
* Check if the Subject has terminated with an exception.
192194
* @return true if the subject has received a throwable through {@code onError}.
193195
*/
196+
@Experimental
194197
public boolean hasThrowable() {
195198
Object o = state.get();
196199
return nl.isError(o);
@@ -199,6 +202,7 @@ public boolean hasThrowable() {
199202
* Check if the Subject has terminated normally.
200203
* @return true if the subject completed normally via {@code onCompleted()}
201204
*/
205+
@Experimental
202206
public boolean hasCompleted() {
203207
Object o = state.get();
204208
return nl.isCompleted(o);
@@ -212,6 +216,7 @@ public boolean hasCompleted() {
212216
* @return the current value or {@code null} if the Subject doesn't have a value,
213217
* has terminated or has an actual {@code null} as a valid value.
214218
*/
219+
@Experimental
215220
public T getValue() {
216221
Object o = state.get();
217222
if (nl.isNext(o)) {
@@ -224,6 +229,7 @@ public T getValue() {
224229
* @return the Throwable that terminated the Subject or {@code null} if the
225230
* subject hasn't terminated yet or it terminated normally.
226231
*/
232+
@Experimental
227233
public Throwable getThrowable() {
228234
Object o = state.get();
229235
if (nl.isError(o)) {

src/main/java/rx/subjects/PublishSubject.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.util.List;
2020

2121
import rx.Observer;
22+
import rx.annotations.Experimental;
2223
import rx.exceptions.CompositeException;
2324
import rx.exceptions.Exceptions;
2425
import rx.functions.Action1;
@@ -131,6 +132,7 @@ public boolean hasObservers() {
131132
* Check if the Subject has terminated with an exception.
132133
* @return true if the subject has received a throwable through {@code onError}.
133134
*/
135+
@Experimental
134136
public boolean hasThrowable() {
135137
Object o = state.get();
136138
return nl.isError(o);
@@ -139,6 +141,7 @@ public boolean hasThrowable() {
139141
* Check if the Subject has terminated normally.
140142
* @return true if the subject completed normally via {@code onCompleted}
141143
*/
144+
@Experimental
142145
public boolean hasCompleted() {
143146
Object o = state.get();
144147
return o != null && !nl.isError(o);
@@ -148,6 +151,7 @@ public boolean hasCompleted() {
148151
* @return the Throwable that terminated the Subject or {@code null} if the
149152
* subject hasn't terminated yet or it terminated normally.
150153
*/
154+
@Experimental
151155
public Throwable getThrowable() {
152156
Object o = state.get();
153157
if (nl.isError(o)) {

src/main/java/rx/subjects/ReplaySubject.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
import rx.Observer;
2525
import rx.Scheduler;
26+
import rx.annotations.Experimental;
2627
import rx.exceptions.CompositeException;
2728
import rx.exceptions.Exceptions;
2829
import rx.functions.Action1;
@@ -1061,6 +1062,7 @@ public void evictFinal(NodeList<Object> list) {
10611062
* Check if the Subject has terminated with an exception.
10621063
* @return true if the subject has received a throwable through {@code onError}.
10631064
*/
1065+
@Experimental
10641066
public boolean hasThrowable() {
10651067
NotificationLite<T> nl = ssm.nl;
10661068
Object o = ssm.get();
@@ -1070,6 +1072,7 @@ public boolean hasThrowable() {
10701072
* Check if the Subject has terminated normally.
10711073
* @return true if the subject completed normally via {@code onCompleted}
10721074
*/
1075+
@Experimental
10731076
public boolean hasCompleted() {
10741077
NotificationLite<T> nl = ssm.nl;
10751078
Object o = ssm.get();
@@ -1080,6 +1083,7 @@ public boolean hasCompleted() {
10801083
* @return the Throwable that terminated the Subject or {@code null} if the
10811084
* subject hasn't terminated yet or it terminated normally.
10821085
*/
1086+
@Experimental
10831087
public Throwable getThrowable() {
10841088
NotificationLite<T> nl = ssm.nl;
10851089
Object o = ssm.get();
@@ -1092,12 +1096,14 @@ public Throwable getThrowable() {
10921096
* Returns the current number of items (non-terminal events) available for replay.
10931097
* @return the number of items available
10941098
*/
1099+
@Experimental
10951100
public int size() {
10961101
return state.size();
10971102
}
10981103
/**
10991104
* @return true if the Subject holds at least one non-terminal event available for replay
11001105
*/
1106+
@Experimental
11011107
public boolean hasAnyValue() {
11021108
return !state.isEmpty();
11031109
}
@@ -1107,6 +1113,7 @@ public boolean hasAnyValue() {
11071113
* @return returns a snapshot of the currently buffered non-terminal events.
11081114
*/
11091115
@SuppressWarnings("unchecked")
1116+
@Experimental
11101117
public Object[] getValues() {
11111118
return state.toArray((T[])EMPTY_ARRAY);
11121119
}
@@ -1116,6 +1123,7 @@ public Object[] getValues() {
11161123
* @param a the array to fill in
11171124
* @return the array {@code a} if it had enough capacity or a new array containing the available values
11181125
*/
1126+
@Experimental
11191127
public T[] getValues(T[] a) {
11201128
return state.toArray(a);
11211129
}

0 commit comments

Comments
 (0)