
Modern Java Recipes. Simple Solutions to Difficult



Modern Java Recipes. Simple Solutions to Difficult - Najlepsze oferty
Modern Java Recipes. Simple Solutions to Difficult - Opis
The introduction of functional programming concepts in Java SE 8 was a drastic change for this venerable object-oriented language. Lambda expressions, method references, and streams fundamentally changed the idioms of the language, and many developers have been trying to catch up ever since. This cookbook will help. With more than 70 detailed recipes, author Ken Kousen shows you how to use the newest features of Java to solve a wide range of problems.For developers comfortable with previous Java versions, this guide covers nearly all of Java SE 8, and includes a chapter focused on changes coming in Java 9. Need to understand how functional idioms will change the way you write code? This cookbook-chock full of use cases-is for you.Recipes cover:The basics of lambda expressions and method referencesInterfaces in the java.util.function packageStream operations for transforming and filtering dataComparators and Collectors for sorting and converting streaming dataCombining lambdas, method references, and streamsCreating instances and extract values from Java...s Optional typeNew I/O capabilities that support functional streamsThe Date-Time API that replaces the legacy Date and Calendar classesMechanisms for experimenting with concurrency and parallelism Spis treści:Foreword
Preface
Modern Java
Who Should Read This Book
How This Book Is Organized
Conventions Used in This Book
Using Code Examples
OReilly Safari
How to Contact Us
Acknowledgments
1. The Basics
1.1. Lambda Expressions
1.2. Method References
1.3. Constructor (...) więcej References
1.4. Functional Interfaces
1.5. Default Methods in Interfaces
1.6. Static Methods in Interfaces
2. The java.util.function Package
2.1. Consumers
2.2. Suppliers
2.3. Predicates
2.4. Functions
3. Streams
3.1. Creating Streams
3.2. Boxed Streams
3.3. Reduction Operations Using Reduce
3.4. Check Sorting Using Reduce
3.5. Debugging Streams with peek
3.6. Converting Strings to Streams and Back
3.7. Counting Elements
3.8. Summary Statistics
3.9. Finding the First Element in a Stream
3.10. Using anyMatch, allMatch, and noneMatch
3.11. Stream flatMap Versus map
3.12. Concatenating Streams
3.13. Lazy Streams
4. Comparators and Collectors
4.1. Sorting Using a Comparator
4.2. Converting a Stream into a Collection
4.3. Adding a Linear Collection to a Map
4.4. Sorting Maps
4.5. Partitioning and Grouping
4.6. Downstream Collectors
4.7. Finding Max and Min Values
4.8. Creating Immutable Collections
4.9. Implementing the Collector Interface
5. Issues with Streams, Lambdas, and Method References
5.1. The java.util.Objects Class
5.2. Lambdas and Effectively Final
5.3. Streams of Random Numbers
5.4. Default Methods in Map
5.5. Default Method Conflict
5.6. Iterating Over Collections and Maps
5.7. Logging with a Supplier
5.8. Closure Composition
5.9. Using an Extracted Method for Exception Handling
5.10. Checked Exceptions and Lambdas
5.11. Using a Generic Exception Wrapper
6. The Optional Type
6.1. Creating an Optional
6.2. Retrieving Values from an Optional
6.3. Optional in Getters and Setters
6.4. Optional flatMap Versus map
6.5. Mapping Optionals
7. File I/O
7.1. Process Files
7.2. Retrieving Files as a Stream
7.3. Walking the Filesystem
7.4. Searching the Filesystem
8. The java.time Package
8.1. Using the Basic Date-Time Classes
8.2. Creating Dates and Times from Existing Instances
8.3. Adjusters and Queries
8.4. Convert from java.util.Date to java.time.LocalDate
8.5. Parsing and Formatting
8.6. Finding Time Zones with Unusual Offsets
8.7. Finding Region Names from Offsets
8.8. Time Between Events
9. Parallelism and Concurrency
9.1. Converting from Sequential to Parallel Streams
9.2. When Parallel Helps
9.3. Changing the Pool Size
9.4. The Future Interface
9.5. Completing a CompletableFuture
9.6. Coordinating CompletableFutures, Part 1
9.7. Coordinating CompletableFutures, Part 2
10. Java 9 Additions
10.1. Modules in Jigsaw
10.2. Private Methods in Interfaces
10.3. Creating Immutable Collections
10.4. Stream: ofNullable, iterate, takeWhile, and dropWhile
10.5. Downstream Collectors: filtering and flatMapping
10.6. Optional: stream, or, ifPresentOrElse
10.7. Date Ranges
A. Generics and Java 8
Background
What Everybody Knows
What Some Developers Dont Realize
Wildcards and PECS
Examples from the Java 8 API
Summary
Index mniej
Modern Java Recipes. Simple Solutions to Difficult - Opinie i recenzje
Na liście znajdują się opinie, które zostały zweryfikowane (potwierdzone zakupem) i oznaczone są one zielonym znakiem Zaufanych Opinii. Opinie niezweryfikowane nie posiadają wskazanego oznaczenia.