• Метод map принимает функцию, которая вызывается для каждого элемента стрима и преобразует его в другое значение. В результате получается стрим с преобразованными элементами, структура стрима при этом не меняется.
• Метод flatMap принимает функцию, которая преобразует каждый элемент стрима в новый стрим. Затем flatMap объединяет (склеивает) полученные стримы в один общий. Пример. У нас есть список заказов, а каждый заказ содержит список купленных вещей. Получить список всех купленных вещей можно так:
• Метод map принимает функцию, которая вызывается для каждого элемента стрима и преобразует его в другое значение. В результате получается стрим с преобразованными элементами, структура стрима при этом не меняется.
• Метод flatMap принимает функцию, которая преобразует каждый элемент стрима в новый стрим. Затем flatMap объединяет (склеивает) полученные стримы в один общий. Пример. У нас есть список заказов, а каждый заказ содержит список купленных вещей. Получить список всех купленных вещей можно так:
Anastasia Vlasova/Getty Images The next bit isn’t clear, but Durov reportedly claimed that his resignation, dated March 21st, was an April Fools’ prank. TechCrunch implies that it was a matter of principle, but it’s hard to be clear on the wheres, whos and whys. Similarly, on April 17th, the Moscow Times quoted Durov as saying that he quit the company after being pressured to reveal account details about Ukrainians protesting the then-president Viktor Yanukovych. But Telegram says people want to keep their chat history when they get a new phone, and they like having a data backup that will sync their chats across multiple devices. And that is why they let people choose whether they want their messages to be encrypted or not. When not turned on, though, chats are stored on Telegram's services, which are scattered throughout the world. But it has "disclosed 0 bytes of user data to third parties, including governments," Telegram states on its website. This provided opportunity to their linked entities to offload their shares at higher prices and make significant profits at the cost of unsuspecting retail investors. In the past, it was noticed that through bulk SMSes, investors were induced to invest in or purchase the stocks of certain listed companies.
from pl