• Метод map принимает функцию, которая вызывается для каждого элемента стрима и преобразует его в другое значение. В результате получается стрим с преобразованными элементами, структура стрима при этом не меняется.
• Метод flatMap принимает функцию, которая преобразует каждый элемент стрима в новый стрим. Затем flatMap объединяет (склеивает) полученные стримы в один общий. Пример. У нас есть список заказов, а каждый заказ содержит список купленных вещей. Получить список всех купленных вещей можно так:
• Метод map принимает функцию, которая вызывается для каждого элемента стрима и преобразует его в другое значение. В результате получается стрим с преобразованными элементами, структура стрима при этом не меняется.
• Метод flatMap принимает функцию, которая преобразует каждый элемент стрима в новый стрим. Затем flatMap объединяет (склеивает) полученные стримы в один общий. Пример. У нас есть список заказов, а каждый заказ содержит список купленных вещей. Получить список всех купленных вещей можно так:
Continuing its crackdown against entities allegedly involved in a front-running scam using messaging app Telegram, Sebi on Thursday carried out search and seizure operations at the premises of eight entities in multiple locations across the country. "Markets were cheering this economic recovery and return to strong economic growth, but the cheers will turn to tears if the inflation outbreak pushes businesses and consumers to the brink of recession," he added. In addition, Telegram's architecture limits the ability to slow the spread of false information: the lack of a central public feed, and the fact that comments are easily disabled in channels, reduce the space for public pushback. And indeed, volatility has been a hallmark of the market environment so far in 2022, with the S&P 500 still down more than 10% for the year-to-date after first sliding into a correction last month. The CBOE Volatility Index, or VIX, has held at a lofty level of more than 30. He said that since his platform does not have the capacity to check all channels, it may restrict some in Russia and Ukraine "for the duration of the conflict," but then reversed course hours later after many users complained that Telegram was an important source of information.
from jp