Martin Ahrer

Thinking outside the box

0001-01-01 1 min read

The following describes selected improvements of the Java API. See the Java 14 release notes.

Unresolved directive in <stdin> - include::NullPointerExceptions.adoc[leveloffset=+1] Unresolved directive in <stdin> - include::AccountingCurrencyFormatSupport.adoc[leveloffset=+1]

0001-01-01 1 min read

The following describes selected improvements of the Java JVM. See the Java 14 release notes.

0001-01-01 1 min read

The following describes selected improvements of the Java language. See Java Language Changes for Java SE 14

Java 14 is introducing the following language enhancements as developer preview.

  • JEP 305 is introducing Pattern Matching for instanceof and is eliminating boilerplate code.

  • JEP 359 introduces Record to reduce repetitive boilerplate code in data model POJOs.

Continue reading

0001-01-01 1 min read
Switch Expression
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/fourteen/lang/SwitchExpressions.java[tag=switchExpression]
  1. The compiler warns when cases are not exhausted. A default clause is required. However, for enum switch expressions that cover all known constants, the compiler inserts an implicit default clause.

Switch Expression Yield
Continue reading

0001-01-01 1 min read

By applying a filter predicate we can adapt a collector to accept only elements matching a predicate.

Filtering
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/nine/api/CollectorsApi.java[tag=filtering]

With the new flatMapping method a stream of streams or stream of collections a collector is adapted to return a flattened result.

Continue reading

0001-01-01 1 min read

Factory methods have been added to the Collections class for simplifying list creation.

Empty list with {java8}
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/nine/api/ImmutableListFactory.java[tag=immutableEmptyList]
Empty list with {java9}
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/nine/api/ImmutableListFactory.java[tag=immutableEmptyListJava9]
List with {java8}
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/nine/api/ImmutableListFactory.java[tag=immutableListJava8]
List with {java9}
Continue reading

0001-01-01 1 min read

Factory methods have been added to the Collections class for simplifying map entry creation.

Immutable Empty Map
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/nine/api/ImmutableMapEntryFactory.java[tag=immutableEmptyMap]
Immutable Map
Unresolved directive in <stdin> - include::../../../../../../../../src/main/java/nine/api/ImmutableMapEntryFactory.java[tag=immutableMap]
Older posts Newer posts