Models: do we need the interfaces extending Map?
See original GitHub issueThere are several model interfaces:
Paths
, ServerVariables
, Content
, APIResponses
, Scopes
, Callback
,
that extends, Map<String, T>
My points are:
1/ Those Interfaces are really strange, when working with it, you never can not use stuff like:
Arrays.asList(..)
- Streams + Collectors
2/ To implement #240 we might need to remove those interface. How do you create an immutable version of Paths
3/ The KaiZen-Parser models do not use such a construct.
Issue Analytics
- State:
- Created 5 years ago
- Comments:17 (17 by maintainers)
Top Results From Across the Web
Extend table maps that are used as interfaces | Dynamics 365
This article describes how to extend table maps that are used as interfaces.
Read more >Understanding and using interfaces in TypeScript
Indexable types are helpful when you have to define custom properties and functions that should operate on a range of values of the...
Read more >Why does Map not extend Collection interface [duplicate]
Collection assume elements of one value. Map assumes entries of key/value pairs. They could have been engineered to re-use the same common ...
Read more >The Map Interface (The Java™ Tutorials > Collections ...
A Map is an object that maps keys to values. A map cannot contain duplicate keys: Each key can map to at most...
Read more >Collection Classes: List, Set, Map
The SortedSet interface extends Set with operations based on some ordering of the elements in a set; when constructing an object from a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
PR for
1.1
: #283 PR for2.0
: #287In my opinion we do not need to have both:
This will be confusing.
The builder pattern make sense for the single add item, using this method:
addPathItems(String, PathItem)
See this example (from the TCK):
I do not see the benefit of having a builder pattern for the Map. Even with the new builder method for Maps (
java.util.Map.of(k1, v1, k2, v2)
- Java 10), I think that the single add builder method is more readable.My recommendation, add a simple setter like this:
If we use a setter method, then it is natural to have a
void
return value.