@@ -30,6 +30,7 @@ protected Subject(OnSubscribe<R> onSubscribe) {
30
30
31
31
/**
32
32
* Indicates whether the {@link Subject} has {@link Observer Observers} subscribed to it.
33
+ *
33
34
* @return true if there is at least one Observer subscribed to this Subject, false otherwise
34
35
*/
35
36
public abstract boolean hasObservers ();
@@ -58,7 +59,9 @@ public final SerializedSubject<T, R> toSerialized() {
58
59
/**
59
60
* Check if the Subject has terminated with an exception.
60
61
* <p>The operation is threadsafe.
61
- * @return true if the subject has received a throwable through {@code onError}.
62
+ *
63
+ * @return {@code true} if the subject has received a throwable through {@code onError}.
64
+ * @since (If this graduates from being an Experimental class method, replace this parenthetical with the release number)
62
65
*/
63
66
@ Experimental
64
67
public boolean hasThrowable () {
@@ -67,7 +70,9 @@ public boolean hasThrowable() {
67
70
/**
68
71
* Check if the Subject has terminated normally.
69
72
* <p>The operation is threadsafe.
70
- * @return true if the subject completed normally via {@code onCompleted}
73
+ *
74
+ * @return {@code true} if the subject completed normally via {@code onCompleted}
75
+ * @since (If this graduates from being an Experimental class method, replace this parenthetical with the release number)
71
76
*/
72
77
@ Experimental
73
78
public boolean hasCompleted () {
@@ -76,8 +81,10 @@ public boolean hasCompleted() {
76
81
/**
77
82
* Returns the Throwable that terminated the Subject.
78
83
* <p>The operation is threadsafe.
79
- * @return the Throwable that terminated the Subject or {@code null} if the
80
- * subject hasn't terminated yet or it terminated normally.
84
+ *
85
+ * @return the Throwable that terminated the Subject or {@code null} if the subject hasn't terminated yet or
86
+ * if it terminated normally.
87
+ * @since (If this graduates from being an Experimental class method, replace this parenthetical with the release number)
81
88
*/
82
89
@ Experimental
83
90
public Throwable getThrowable () {
@@ -89,7 +96,9 @@ public Throwable getThrowable() {
89
96
* <p>Note that unless {@link #hasCompleted()} or {@link #hasThrowable()} returns true, the value
90
97
* retrieved by {@code getValue()} may get outdated.
91
98
* <p>The operation is threadsafe.
92
- * @return true if and only if the subject has some value but not an error
99
+ *
100
+ * @return {@code true} if and only if the subject has some value but not an error
101
+ * @since (If this graduates from being an Experimental class method, replace this parenthetical with the release number)
93
102
*/
94
103
@ Experimental
95
104
public boolean hasValue () {
@@ -102,8 +111,10 @@ public boolean hasValue() {
102
111
* and {@link #hasCompleted()} to determine if such {@code null} is a valid value, there was an
103
112
* exception or the Subject terminated without receiving any value.
104
113
* <p>The operation is threadsafe.
105
- * @return the current value or {@code null} if the Subject doesn't have a value,
106
- * has terminated with an exception or has an actual {@code null} as a value.
114
+ *
115
+ * @return the current value or {@code null} if the Subject doesn't have a value, has terminated with an
116
+ * exception or has an actual {@code null} as a value.
117
+ * @since (If this graduates from being an Experimental class method, replace this parenthetical with the release number)
107
118
*/
108
119
@ Experimental
109
120
public T getValue () {
@@ -114,7 +125,9 @@ public T getValue() {
114
125
/**
115
126
* Returns a snapshot of the currently buffered non-terminal events.
116
127
* <p>The operation is threadsafe.
128
+ *
117
129
* @return a snapshot of the currently buffered non-terminal events.
130
+ * @since (If this graduates from being an Experimental class method, replace this parenthetical with the release number)
118
131
*/
119
132
@ SuppressWarnings ("unchecked" )
120
133
@ Experimental
@@ -131,10 +144,12 @@ public Object[] getValues() {
131
144
* <p>If the subject's values fit in the specified array with room to spare
132
145
* (i.e., the array has more elements than the list), the element in
133
146
* the array immediately following the end of the subject's values is set to
134
- * <tt> null</tt> .
147
+ * {@code null} .
135
148
* <p>The operation is threadsafe.
149
+ *
136
150
* @param a the array to fill in
137
151
* @return the array {@code a} if it had enough capacity or a new array containing the available values
152
+ * @since (If this graduates from being an Experimental class method, replace this parenthetical with the release number)
138
153
*/
139
154
@ Experimental
140
155
public T [] getValues (T [] a ) {
0 commit comments