1.Introduction
2.Lambda expressions
- 2.1Start a thread - A simple example
- 2.2Functional interfaces
- Functional interfaces and single responsibility principle
- 2.3Target typing
- Standalone expressions and Poly expressions
- 2.4Lambda expressions
- 2.5Lexical scoping
- 2.6Effectively final local variables
- 2.7Method references
- 2.7.1Types of method references
- 2.8Default interface methods
- 2.8.1Static interface methods
3.Functional interfaces
- 3.1Functions
- 3.1.1
Function - 3.1.2
BiFunction - 3.1.3
FunctionandBiFunctionwith predefined types - 3.2Consumers
- 3.2.1
Consumer - 3.2.2
BiConsumer - 3.2.3
Consumerwith predefined types - 3.2.4Example of using
Consumer - 3.3Suppliers
- 3.3.1
Supplier - 3.3.2
Supplierwith predefined types - 3.4Predicates
- 3.4.1
Predicate - 3.4.2
BiPredicate - 3.4.3
PredicateandBiPredicatewith predefined types - 3.5Operators
- 3.5.1
UnaryOperator - 3.5.2
BinaryOperator - 3.5.3Operators with predefined types
4.Streams
- 4.1User-specified behavior
- 4.2Basic stream concepts
- 4.2.1Sequential or parallel
- 4.2.2Encounter order
- 4.3Stream operation characteristics
- 4.3.1Stateful or stateless
- 4.4
Stream - 4.5
Spliterator - 4.5.1
Spliteratorcharacteristics - 4.5.2
Spliterators for primitive types - 4.5.3
Spliteratorsto createSpliterators - 4.5.4Late-binding and fail-fast
- 4.6
BaseStream - 4.7
StreamSource - 4.8
Streamstatic methods - 4.9Stream sources
- 4.9.1Arrays
- 4.9.2Collections
- 4.9.3Stream builder
- 4.9.4I/O channels
- 4.9.4.1lines
- 4.9.4.2list
- 4.9.4.3walk
- 4.9.4.4find
- 4.10Examples for stream processing
- 4.11Stream intermediate operations
- 4.11.1
map - 4.11.2
flatMap - 4.11.3
filter - 4.11.4
distinct - 4.11.5
limit - 4.11.6
skip - 4.11.7
sorted - 4.11.8
peek - 4.11.9Operations chaining
- 4.12Stream terminal operations
- 4.12.1
forEachandforEachOrdered - 4.12.2
reduce - 4.12.3
maxandmin - 4.12.4match
- 4.12.5find
- 4.12.6
toArray - 4.12.7
collect - 4.12.8
Collectors - 4.12.8.1Collect into collections
- 4.12.8.2
groupingBy - 4.12.8.3
joining - 4.12.8.4
mapping - 4.12.8.5
partitioningBy - 4.12.8.6
counting - 4.12.8.7averaging
- 4.12.8.8summing
- 4.12.8.9
maxByandminBy - 4.12.8.10summarizing
- 4.12.8.11
collectingAndThen - 4.12.8.12
reducing - 4.12.9Parallel stream
- 4.12.9.1Parallel reduction
- 4.13How-tos
- 4.13.1How to convert a
Collectionto aMap? - 4.13.2How to filter map entries by keys?
- 4.13.3How to filter map entries by values?
- 4.13.4How to group elements by multiple conditions?
- 4.13.5How to combine multiple collections into a stream?
- 4.13.6How to convert a stream to another stream with different type?
- 4.13.7How to find an element in the stream?
- 4.13.8How to sort map entries?
- 4.13.9How to do multiple operations on a stream?
- 4.13.10How to count elements after grouping?
- 4.13.11Exceptions Handling in Streams
5.Optional
- 5.1What’s
Optional - 5.2Usage of
Optional - 5.2.1Simple usage
- 5.2.2Chained usage
- 5.2.3Functional usage
- 5.3How-tos
- 5.3.1How to interact with legacy library code before
Optional? - 5.3.2How to get value from chained
Optionalreference path? - 5.3.3How to get first value of a list of
Optionals? - 5.3.4How to chain method invocations with return value of
Optionalobjects in sequence? - 5.3.5How to convert an
Optionalobject to a stream? - 5.3.6How to use
Optionalto check fornulland assign default values? - 5.4Updates after Java 8