- 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.
- Django 2 by Example
- Proxmox High Availability
- 物聯(lián)網(wǎng)+BIM:構(gòu)建數(shù)字孿生的未來(lái)
- Drush User’s Guide
- 面向物聯(lián)網(wǎng)的嵌入式系統(tǒng)開(kāi)發(fā):基于CC2530和STM32微處理器
- Building RESTful Web services with Go
- 圖解手機(jī)元器件維修技巧
- IPv6網(wǎng)絡(luò)切片:使能千行百業(yè)新體驗(yàn)
- 6G新技術(shù) 新網(wǎng)絡(luò) 新通信
- 通信十年:擁抱互聯(lián)網(wǎng)
- SAE原理與網(wǎng)絡(luò)規(guī)劃
- Hands-On Microservices with Node.js
- 轉(zhuǎn)化:提升網(wǎng)站流量和轉(zhuǎn)化率的技巧
- 組網(wǎng)技術(shù)與網(wǎng)絡(luò)管理
- 云計(jì)算技術(shù)與標(biāo)準(zhǔn)化