3 ms·
An example of good idiomatic Java 8 source code. Example: https://github.com/mrwilson/java-dirty/blob/master/src/main/java/uk/co/probablyfine/dirty/Store.java
by sgt 12y ago
An example of good idiomatic Java 8 source code.
Example:
https://github.com/mrwilson/java-dirty/blob/master/src/main/java/uk/co/probablyfine/dirty/Store.java https://github.com/mrwilson/java-dirty/blob/master/src/main/...
- agibsonccc 12y agoIf only enterprise didn't move so slow =/. I wish I could migrate to 8.
- famousactress 12y agoThanks. Curious... are the parens meaningful in this method body? private int getPartition(int globalInsertionPosition) { return (globalInsertionPosition) / this.sizePerPartition; }
- probablyfine 12y agoNo, that's likely a leftover from refactoring. Good spot.
- famousactress 12y agoHaha, no worries! I've been checked out of Java for a while and I was a little bit worried that this was semantically meaningful, which would be a pretty confusing addition to the language :)
- deleted 12y ago[deleted]
- tlrobinson 12y agoWhat are the Java 8 features being used here, besides the obvious lambda expressions? (genuine question, I haven't stayed current with Java)
- sgt 12y agoStreams are also being used.
- cedrickthecrow 12y agoOptional is also new to Java 8 although syntactically very similar that Guava.