File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
rxjava-core/src/main/java/rx Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -4332,6 +4332,23 @@ public BlockingObservable<T> toBlockingObservable() {
4332
4332
return BlockingObservable .from (this );
4333
4333
}
4334
4334
4335
+ /**
4336
+ * Converts the elements of an observable sequence to the specified type.
4337
+ *
4338
+ * @return An observable sequence that contains each element of the source
4339
+ * sequence converted to the specified type.
4340
+ *
4341
+ * @see <a href="http://msdn.microsoft.com/en-us/library/hh211842(v=vs.103).aspx">MSDN: Observable.Cast</a>
4342
+ */
4343
+ public <R > Observable <R > cast () {
4344
+ return map (new Func1 <T , R >() {
4345
+ @ SuppressWarnings ("unchecked" )
4346
+ public R call (T t ) {
4347
+ return (R ) t ;
4348
+ }
4349
+ });
4350
+ }
4351
+
4335
4352
/**
4336
4353
* Whether a given {@link Function} is an internal implementation inside rx.* packages or not.
4337
4354
* <p>
You can’t perform that action at this time.
0 commit comments