- Hands-On Reactive Programming in Spring 5
- Oleh Dokuka Igor Lozynskyi
- 178字
- 2021-07-23 16:36:22
Map operator
Unquestioningly, the most used operator in RxJava is map, which has the following signature:
<R> Observable<R> map(Func1<T, R> func)
The preceding method declaration means that the func function can transform the T object type to the R object type, and applying map transforms Observable<T> into Observable<R>. However, a signature does not always describe the operator's behavior well, especially if the operator is doing a complex transformation. For these purposes, Marble diagrams were invented. Marble diagrams visually present stream transformations. They are so effective for describing the operator's behavior that almost all RxJava operators contain the image with a marble diagram in Javadoc. The map operator is represented by the following diagram:

From looking at the preceding diagram, it should be clear that the map makes a one-to-one transformation. Furthermore, the output stream has the same number of elements as the input stream.
- 社交網(wǎng)絡對齊
- 物聯(lián)網(wǎng)工程規(guī)劃技術
- 物聯(lián)網(wǎng)(IoT)基礎:網(wǎng)絡技術+協(xié)議+用例
- C++黑客編程揭秘與防范
- 物聯(lián)網(wǎng)識別技術
- 網(wǎng)絡創(chuàng)新指數(shù)研究
- HCNA網(wǎng)絡技術
- SSL VPN : Understanding, evaluating and planning secure, web/based remote access
- 面向5G-Advanced的關鍵技術
- AIoT應用開發(fā)與實踐
- Laravel Application Development Cookbook
- 走近奇妙的物聯(lián)網(wǎng)
- 一本書讀懂移動物聯(lián)網(wǎng)
- Building Microservices with Spring
- 物聯(lián)網(wǎng)商業(yè)設計與案例