Suche senden
Hochladen
Guava - Elements of Functional Programming
•
0 gefällt mir
•
263 views
Anna Shymchenko
Folgen
Guava - Elements of Functional Programming
Weniger lesen
Mehr lesen
Software
Melden
Teilen
Melden
Teilen
1 von 28
Empfohlen
Finch + Finagle OAuth2
Finch + Finagle OAuth2
Vladimir Kostyukov
2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js
Noritada Shimizu
Mozilla とブラウザゲーム
Mozilla とブラウザゲーム
Noritada Shimizu
20151224-games
20151224-games
Noritada Shimizu
Scala on Your Phone
Scala on Your Phone
Michael Galpin
Introduction to Go for Java Programmers
Introduction to Go for Java Programmers
Kalpa Pathum Welivitigoda
Практическое применения Akka Streams
Практическое применения Akka Streams
Alexey Romanchuk
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
2ГИС Технологии
Empfohlen
Finch + Finagle OAuth2
Finch + Finagle OAuth2
Vladimir Kostyukov
2016 gunma.web games-and-asm.js
2016 gunma.web games-and-asm.js
Noritada Shimizu
Mozilla とブラウザゲーム
Mozilla とブラウザゲーム
Noritada Shimizu
20151224-games
20151224-games
Noritada Shimizu
Scala on Your Phone
Scala on Your Phone
Michael Galpin
Introduction to Go for Java Programmers
Introduction to Go for Java Programmers
Kalpa Pathum Welivitigoda
Практическое применения Akka Streams
Практическое применения Akka Streams
Alexey Romanchuk
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
«Практическое применение Akka Streams» — Алексей Романчук, 2ГИС
2ГИС Технологии
Git avançado
Git avançado
Jean Carlo Machado
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
MongoDB
Operation Flow @ ChicagoRoboto
Operation Flow @ ChicagoRoboto
Seyed Jafari
2 a networkflow
2 a networkflow
Aravindharamanan S
Functional php
Functional php
Jean Carlo Machado
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
MongoDB
Simplifying java with lambdas (short)
Simplifying java with lambdas (short)
RichardWarburton
Writing a compiler in go
Writing a compiler in go
Yusuke Kita
Jggug 2010 330 Grails 1.3 観察
Jggug 2010 330 Grails 1.3 観察
Tsuyoshi Yamamoto
Webmontag Berlin "coffee script"
Webmontag Berlin "coffee script"
Webmontag Berlin
G* on GAE/J 挑戦編
G* on GAE/J 挑戦編
Tsuyoshi Yamamoto
Node.js - Demnächst auf einem Server in Ihrer Nähe
Node.js - Demnächst auf einem Server in Ihrer Nähe
Ralph Winzinger
20180310 functional programming
20180310 functional programming
Chiwon Song
20181020 advanced higher-order function
20181020 advanced higher-order function
Chiwon Song
Darkmira Tour PHP 2016 - Automatizando Tarefas com Phing
Darkmira Tour PHP 2016 - Automatizando Tarefas com Phing
Matheus Marabesi
はじめてのGroovy
はじめてのGroovy
Tsuyoshi Yamamoto
week-14x
week-14x
KITE www.kitecolleges.com
Program(Output)
Program(Output)
princy75
Implementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 redux
Eleanor McHugh
How te bring common UI patterns to ADF
How te bring common UI patterns to ADF
Getting value from IoT, Integration and Data Analytics
How to Bring Common UI Patterns to ADF
How to Bring Common UI Patterns to ADF
Luc Bors
Weitere ähnliche Inhalte
Was ist angesagt?
Git avançado
Git avançado
Jean Carlo Machado
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
MongoDB
Operation Flow @ ChicagoRoboto
Operation Flow @ ChicagoRoboto
Seyed Jafari
2 a networkflow
2 a networkflow
Aravindharamanan S
Functional php
Functional php
Jean Carlo Machado
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
MongoDB
Simplifying java with lambdas (short)
Simplifying java with lambdas (short)
RichardWarburton
Writing a compiler in go
Writing a compiler in go
Yusuke Kita
Jggug 2010 330 Grails 1.3 観察
Jggug 2010 330 Grails 1.3 観察
Tsuyoshi Yamamoto
Webmontag Berlin "coffee script"
Webmontag Berlin "coffee script"
Webmontag Berlin
G* on GAE/J 挑戦編
G* on GAE/J 挑戦編
Tsuyoshi Yamamoto
Node.js - Demnächst auf einem Server in Ihrer Nähe
Node.js - Demnächst auf einem Server in Ihrer Nähe
Ralph Winzinger
20180310 functional programming
20180310 functional programming
Chiwon Song
20181020 advanced higher-order function
20181020 advanced higher-order function
Chiwon Song
Darkmira Tour PHP 2016 - Automatizando Tarefas com Phing
Darkmira Tour PHP 2016 - Automatizando Tarefas com Phing
Matheus Marabesi
はじめてのGroovy
はじめてのGroovy
Tsuyoshi Yamamoto
week-14x
week-14x
KITE www.kitecolleges.com
Program(Output)
Program(Output)
princy75
Implementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 redux
Eleanor McHugh
Was ist angesagt?
(20)
Git avançado
Git avançado
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Operation Flow @ ChicagoRoboto
Operation Flow @ ChicagoRoboto
2 a networkflow
2 a networkflow
Functional php
Functional php
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Building Real Time Systems on MongoDB Using the Oplog at Stripe
Simplifying java with lambdas (short)
Simplifying java with lambdas (short)
Writing a compiler in go
Writing a compiler in go
Jggug 2010 330 Grails 1.3 観察
Jggug 2010 330 Grails 1.3 観察
Webmontag Berlin "coffee script"
Webmontag Berlin "coffee script"
G* on GAE/J 挑戦編
G* on GAE/J 挑戦編
Node.js - Demnächst auf einem Server in Ihrer Nähe
Node.js - Demnächst auf einem Server in Ihrer Nähe
20180310 functional programming
20180310 functional programming
20181020 advanced higher-order function
20181020 advanced higher-order function
Darkmira Tour PHP 2016 - Automatizando Tarefas com Phing
Darkmira Tour PHP 2016 - Automatizando Tarefas com Phing
はじめてのGroovy
はじめてのGroovy
week-14x
week-14x
Program(Output)
Program(Output)
Implementing virtual machines in go & c 2018 redux
Implementing virtual machines in go & c 2018 redux
Ähnlich wie Guava - Elements of Functional Programming
How te bring common UI patterns to ADF
How te bring common UI patterns to ADF
Getting value from IoT, Integration and Data Analytics
How to Bring Common UI Patterns to ADF
How to Bring Common UI Patterns to ADF
Luc Bors
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
Heiko Behrens
関数潮流(Function Tendency)
関数潮流(Function Tendency)
riue
TDC218SP | Trilha Kotlin - DSLs in a Kotlin Way
TDC218SP | Trilha Kotlin - DSLs in a Kotlin Way
tdc-globalcode
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
Dmitry Soshnikov
Creating a Facebook Clone - Part XXXI.pdf
Creating a Facebook Clone - Part XXXI.pdf
ShaiAlmog1
Hitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional Programming
Sergey Shishkin
From java to kotlin beyond alt+shift+cmd+k
From java to kotlin beyond alt+shift+cmd+k
Fabio Collini
つくってあそぼ Kotlin DSL ~拡張編~
つくってあそぼ Kotlin DSL ~拡張編~
kamedon39
Migrating from Flux to Redux. Why and how.
Migrating from Flux to Redux. Why and how.
Astrails
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Thomas Fuchs
Refactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
Hiroshi Ono
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
Hiroshi Ono
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
Hiroshi Ono
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
Hiroshi Ono
FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6
Dmitry Soshnikov
Painless Persistence with Realm
Painless Persistence with Realm
Christian Melchior
Persisting Data on SQLite using Room
Persisting Data on SQLite using Room
Nelson Glauber Leal
Ähnlich wie Guava - Elements of Functional Programming
(20)
How te bring common UI patterns to ADF
How te bring common UI patterns to ADF
How to Bring Common UI Patterns to ADF
How to Bring Common UI Patterns to ADF
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
EclipseCon2011 Cross-Platform Mobile Development with Eclipse
関数潮流(Function Tendency)
関数潮流(Function Tendency)
TDC218SP | Trilha Kotlin - DSLs in a Kotlin Way
TDC218SP | Trilha Kotlin - DSLs in a Kotlin Way
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
Creating a Facebook Clone - Part XXXI.pdf
Creating a Facebook Clone - Part XXXI.pdf
Hitchhiker's Guide to Functional Programming
Hitchhiker's Guide to Functional Programming
From java to kotlin beyond alt+shift+cmd+k
From java to kotlin beyond alt+shift+cmd+k
つくってあそぼ Kotlin DSL ~拡張編~
つくってあそぼ Kotlin DSL ~拡張編~
Migrating from Flux to Redux. Why and how.
Migrating from Flux to Redux. Why and how.
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Zepto.js, a jQuery-compatible mobile JavaScript framework in 2K
Refactoring to Macros with Clojure
Refactoring to Macros with Clojure
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
FalsyValues. Dmitry Soshnikov - ECMAScript 6
FalsyValues. Dmitry Soshnikov - ECMAScript 6
Painless Persistence with Realm
Painless Persistence with Realm
Persisting Data on SQLite using Room
Persisting Data on SQLite using Room
Mehr von Anna Shymchenko
Константин Маркович: "Creating modular application using Spring Boot "
Константин Маркович: "Creating modular application using Spring Boot "
Anna Shymchenko
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Anna Shymchenko
Евгений Руднев: "Programmers Approach to Error Handling"
Евгений Руднев: "Programmers Approach to Error Handling"
Anna Shymchenko
Александр Куцан: "Static Code Analysis in C++"
Александр Куцан: "Static Code Analysis in C++"
Anna Shymchenko
Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club”
Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club”
Anna Shymchenko
Орхан Гасимов: "Reactive Applications in Java with Akka"
Орхан Гасимов: "Reactive Applications in Java with Akka"
Anna Shymchenko
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
Anna Shymchenko
Денис Прокопюк: “JMX in Java EE applications”
Денис Прокопюк: “JMX in Java EE applications”
Anna Shymchenko
Роман Яворский "Introduction to DevOps"
Роман Яворский "Introduction to DevOps"
Anna Shymchenko
Максим Сабарня “NoSQL: Not only SQL in developer’s life”
Максим Сабарня “NoSQL: Not only SQL in developer’s life”
Anna Shymchenko
Андрей Лисниченко "SQL Injection"
Андрей Лисниченко "SQL Injection"
Anna Shymchenko
Светлана Мухина "Metrics on agile projects"
Светлана Мухина "Metrics on agile projects"
Anna Shymchenko
Андрей Слободяник "Test driven development using mockito"
Андрей Слободяник "Test driven development using mockito"
Anna Shymchenko
Евгений Хыст "Application performance database related problems"
Евгений Хыст "Application performance database related problems"
Anna Shymchenko
Даурен Муса “IBM WebSphere - expensive but effective”
Даурен Муса “IBM WebSphere - expensive but effective”
Anna Shymchenko
Александр Пашинский "Reinventing Design Patterns with Java 8"
Александр Пашинский "Reinventing Design Patterns with Java 8"
Anna Shymchenko
Евгений Капинос "Advanced JPA (Java Persistent API)"
Евгений Капинос "Advanced JPA (Java Persistent API)"
Anna Shymchenko
Event-driven architecture with Java technology stack
Event-driven architecture with Java technology stack
Anna Shymchenko
Do we need SOLID principles during software development?
Do we need SOLID principles during software development?
Anna Shymchenko
Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
Anna Shymchenko
Mehr von Anna Shymchenko
(20)
Константин Маркович: "Creating modular application using Spring Boot "
Константин Маркович: "Creating modular application using Spring Boot "
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Евгений Бова: "Modularity in Java: introduction to Jigsaw through the prism o...
Евгений Руднев: "Programmers Approach to Error Handling"
Евгений Руднев: "Programmers Approach to Error Handling"
Александр Куцан: "Static Code Analysis in C++"
Александр Куцан: "Static Code Analysis in C++"
Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club”
Алесей Решта: “Robotics Sport & Luxoft Open Robotics Club”
Орхан Гасимов: "Reactive Applications in Java with Akka"
Орхан Гасимов: "Reactive Applications in Java with Akka"
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
Евгений Хыст: "Server-Side Geo-Clustering Based on Geohash"
Денис Прокопюк: “JMX in Java EE applications”
Денис Прокопюк: “JMX in Java EE applications”
Роман Яворский "Introduction to DevOps"
Роман Яворский "Introduction to DevOps"
Максим Сабарня “NoSQL: Not only SQL in developer’s life”
Максим Сабарня “NoSQL: Not only SQL in developer’s life”
Андрей Лисниченко "SQL Injection"
Андрей Лисниченко "SQL Injection"
Светлана Мухина "Metrics on agile projects"
Светлана Мухина "Metrics on agile projects"
Андрей Слободяник "Test driven development using mockito"
Андрей Слободяник "Test driven development using mockito"
Евгений Хыст "Application performance database related problems"
Евгений Хыст "Application performance database related problems"
Даурен Муса “IBM WebSphere - expensive but effective”
Даурен Муса “IBM WebSphere - expensive but effective”
Александр Пашинский "Reinventing Design Patterns with Java 8"
Александр Пашинский "Reinventing Design Patterns with Java 8"
Евгений Капинос "Advanced JPA (Java Persistent API)"
Евгений Капинос "Advanced JPA (Java Persistent API)"
Event-driven architecture with Java technology stack
Event-driven architecture with Java technology stack
Do we need SOLID principles during software development?
Do we need SOLID principles during software development?
Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
Максим Сабарня и Иван Дрижирук “Vert.x – tool-kit for building reactive app...
Kürzlich hochgeladen
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Mater
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
preethippts
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
andrehoraa
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
Philip Schwarz
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
Andreas Granig
MYjobs Presentation Django-based project
MYjobs Presentation Django-based project
AnoyGreter
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
Hironori Washizaki
Software Coding for software engineering
Software Coding for software engineering
ssuserb3a23b
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
Tier1 app
Cyber security and its impact on E commerce
Cyber security and its impact on E commerce
manigoyal112
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
OnePlan Solutions
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
rcbcrtm
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Ahmed Mohamed
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
Marharyta Nedzelska
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
31events.com
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
Safe Software
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
Christoph Pohl
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Matt Ray
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
umasea
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
Łukasz Chruściel
Kürzlich hochgeladen
(20)
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
MYjobs Presentation Django-based project
MYjobs Presentation Django-based project
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
Software Coding for software engineering
Software Coding for software engineering
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
Cyber security and its impact on E commerce
Cyber security and its impact on E commerce
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
cpct NetworkING BASICS AND NETWORK TOOL.ppt
cpct NetworkING BASICS AND NETWORK TOOL.ppt
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
Guava - Elements of Functional Programming
1.
www.luxoft.com GUAVA Elements of Functional
Programming By Andriy Slobodyanyk
2.
www.luxoft.com Map Function [2, 3,
5] y = x * x [4, 9, 25]
3.
www.luxoft.com Groovy [2,3,5].collect {it *
it}; // [4,9,25] [50, 100, 200].find {it >= 100}; // 100 team.any {Member m -> m.gender == FEMALE};// true ["Ann", "Alex", "Andrey"].every {it.startsWith("A")}; //true [3, 7, 10].max(); // 10
4.
www.luxoft.com ServiceImpl public List<Dto> getAllRecords()
{ List<Dto> result = new ArrayList<>(); for (Entity entity : repository.getEntities()) { Dto dto = new Dto(); dto.setField(entity.getField()); result.add(dto); } return result; }
5.
www.luxoft.com ServiceImpl public Dto getRecordByText(String
text) { Entity entity = repository.getEntityByText(text); Dto dto = new Dto(); dto.setField(entity.getField()); return dto; }
6.
www.luxoft.com Function Interface public interface
Function<F, T> { T apply(F input); }
7.
www.luxoft.com EntityToDtoFunc public class EntityToDtoFunc
implements Function<Entity, Dto> { public Dto apply(Entity entity) { Dto dto = new Dto(); dto.setField(entity.getField()); return dto; } }
8.
www.luxoft.com ServiceImpl public List<Dto> getAllRecords()
{ return Lists.transform( repository.getEntities(), new EntityToDtoFunc()); } public Dto getRecordByText(String text) { Entity entity = repository.getEntityByText(text); return new EntityToDtoFunc().apply(entity); }
9.
www.luxoft.com Predicate public List<Person> getVips
(List<Person> source) { List<Person> result = new ArrayList<>(); for (Person p : source) { if (p.getGender() == FEMALE || p.getAge() <= 16) { result.add(p); } } return result; }
10.
www.luxoft.com Predicate public interface Predicate<T>
{ boolean apply(T input); }
11.
www.luxoft.com Vip Person Predicate public
enum VipPersonPredicate implements Predicate<Person> { INSTANCE; @Override public boolean apply(Person p) { return p.getGender() == FEMALE || p.getAge() <= 16; } }
12.
www.luxoft.com Predicate public List<Person> getVips
(List<Person> source) { return Iterables.filter( source, VipPersonPredicate.INSTANCE); }
13.
www.luxoft.com FluentIterable FluentIterable .from(database.getClientList()) .filter(activeInLastMonth()) .transform(Functions.toStringFunction()) .limit(10) .toList();
14.
www.luxoft.com FluentIterable public List<Dto> getAllRecords()
{ return FluentIterable .from(repository.getEntities()) .transform(EntityToDtoFunc.INSTANCE) .toList(); } public List<Person> getVips (List<Person> source) { return FluentIterable .from(source) .filter(VipPersonPredicate.INSTANCE) .toList(); }
15.
www.luxoft.com Optional List<Dto> records =
service.getAllRecords(); for (Dto dto : records) { // some action }
16.
www.luxoft.com Optional Person person =
service.findRecordBy(text); person.getName(); // NPE???
17.
www.luxoft.com Optional Person person =
service.findRecordBy(text); if (person != null ) { person.getName(); }
18.
www.luxoft.com Optional null exception
new Person() NO_PERSON Optional
19.
www.luxoft.com Optional Optional<Integer> possible =
Optional.of(5); possible.isPresent(); // returns true possible.get(); // returns 5
20.
www.luxoft.com Optional Optional<Person> optPerson =
service.findRecordBy(text); if (optPerson.isPresent()) { Person person = optPerson.get(); person.getName(); }
21.
www.luxoft.com Optional Optional<Person> optPerson =
service.findRecordBy(text); optPerson.or(DEFAULT_PERSON); optPerson.orNull(); optPerson.asSet();
22.
www.luxoft.com Optional Optional<Person> optPerson =
service.findRecordBy(text); for (Person p : optPerson.asSet()) { person.getName(); }
23.
www.luxoft.com Cache public class ServiceImpl
{ public Foo findFooByStr(String str) { // long term running code return result; } }
24.
www.luxoft.com Cache public class ServiceImpl
{ public Foo findFooByStr(key) { fooCache.get(str); } private LoadingCache<Key, Graph> fooCache = CacheBuilder.newBuilder() .maximumSize(1000) .expireAfterWrite(10, TimeUnit.MINUTES) .build( new CacheLoader<String, Foo>() { public Foo load(String str) throws AnyException { // long term running code return result;
25.
www.luxoft.com Joiner String title; String firstName; String
lastName; // Mr. Vasiliy Pupkin return title + + firstName + + lastName;
26.
www.luxoft.com Joiner public String getFullName()
{ return Joiner.on(“ “) .skipNulls() .join(title, firstName, lastName); }
27.
www.luxoft.com Guava Optinal FluentIterable
Cache Joiner Collections EventBus Ordering Preconditions
28.
www.luxoft.com THANK YOU