24
24
import com .google .common .annotations .GwtCompatible ;
25
25
import com .google .common .math .LongMath ;
26
26
import com .google .errorprone .annotations .InlineMe ;
27
+ import com .google .errorprone .annotations .InlineMeValidationDisabled ;
27
28
import java .util .ArrayDeque ;
28
29
import java .util .Collection ;
29
30
import java .util .Deque ;
@@ -105,6 +106,8 @@ public static <T> Stream<T> stream(com.google.common.base.Optional<T> optional)
105
106
* <p><b>Java 9 users:</b> use {@code optional.stream()} instead.
106
107
*/
107
108
@ Beta
109
+ @ InlineMe (replacement = "optional.stream()" )
110
+ @ InlineMeValidationDisabled ("Java 9+ API only" )
108
111
public static <T > Stream <T > stream (java .util .Optional <T > optional ) {
109
112
return optional .isPresent () ? Stream .of (optional .get ()) : Stream .empty ();
110
113
}
@@ -116,6 +119,8 @@ public static <T> Stream<T> stream(java.util.Optional<T> optional) {
116
119
* <p><b>Java 9 users:</b> use {@code optional.stream()} instead.
117
120
*/
118
121
@ Beta
122
+ @ InlineMe (replacement = "optional.stream()" )
123
+ @ InlineMeValidationDisabled ("Java 9+ API only" )
119
124
public static IntStream stream (OptionalInt optional ) {
120
125
return optional .isPresent () ? IntStream .of (optional .getAsInt ()) : IntStream .empty ();
121
126
}
@@ -127,6 +132,8 @@ public static IntStream stream(OptionalInt optional) {
127
132
* <p><b>Java 9 users:</b> use {@code optional.stream()} instead.
128
133
*/
129
134
@ Beta
135
+ @ InlineMe (replacement = "optional.stream()" )
136
+ @ InlineMeValidationDisabled ("Java 9+ API only" )
130
137
public static LongStream stream (OptionalLong optional ) {
131
138
return optional .isPresent () ? LongStream .of (optional .getAsLong ()) : LongStream .empty ();
132
139
}
@@ -138,6 +145,8 @@ public static LongStream stream(OptionalLong optional) {
138
145
* <p><b>Java 9 users:</b> use {@code optional.stream()} instead.
139
146
*/
140
147
@ Beta
148
+ @ InlineMe (replacement = "optional.stream()" )
149
+ @ InlineMeValidationDisabled ("Java 9+ API only" )
141
150
public static DoubleStream stream (OptionalDouble optional ) {
142
151
return optional .isPresent () ? DoubleStream .of (optional .getAsDouble ()) : DoubleStream .empty ();
143
152
}
0 commit comments