Comments (2)
Thanks for the interest in the library!
One design goal of this library is to avoid forcing users to explicitly go through any semantic-anemic types.
While Map.Entry isn't that bad, it has setValue()
, which makes it mutable.
Instead, my opinionated objective is to have the users map()
to their own type at the proper abstraction layer, rather than having to go through some "generic" type as the middle-man.
For example: biStream.map(MyOwnType::new).findFirst()
.
That said, you may not have a MyOwnType
and Map.Entry
could be good enough sometimes. I vaguely recall once considering something along this line, but then figured that it should be easy enough for the user to do:
biStream.map(AbstractMap.SimpleEntry<K, V>::new).findFirst()
I don't remember if that <K, V>
is necessary or the compiler is able to infer.
Let me know if this works for you?
from mug.
Ironically enough I just tried to work through that in my own code and got hung up at setValue() myself - and proceeded to roll my own type. It works nicely. Thanks!
from mug.
Related Issues (17)
- Consider making the tests follow JUnit 5 idioms more closely HOT 5
- 2.3 availability HOT 9
- Problem with Java 8 compilation HOT 1
- Publish a new release with Java 8 support to maven central.
- The type of toImmutableListMultimap(Function<? super E,? extends Object>, Function<? super E,? extends Object>) from the type ImmutableListMultimap is Collector<E,?,ImmutableListMultimap<Object,Object>>, this is incompatible with the descriptor's return type: Collector<E,?,Object> HOT 2
- There is a vulnerability inGuava: Google Core Libraries for Java 29.0-jre,upgrade recommended HOT 4
- [Docs] Possible outdated documentation
- Why limit the chunk size? HOT 3
- Broken links HOT 1
- Provide OSGi Metadata HOT 2
- javadoc link not found HOT 2
- Type Mismatch Errors in Maybe.java Class of com.google.mu.util Package HOT 1
- StringFormat is great. But it's not type safe if the StringFormat is defined far away. HOT 3
- Consider deprecating `StringFormat.strict()` HOT 1
- RocksDB with BiStream HOT 2
- BiStream.sortedBy[Values,Keys] gives unexpected output HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mug.