vert.x icon indicating copy to clipboard operation
vert.x copied to clipboard

Add support for default values to Multimap#get

Open privettoli opened this issue 5 years ago • 7 comments

Motivation:

When using MultiMap, I want my code to be more readable, therefore, I want to use Map#getOrDefault - alike methods.

privettoli avatar Jun 09 '20 17:06 privettoli

I think we can have this however it should be named get following the same pattern than JsonObject and JsonArray uses

vietj avatar Jun 09 '20 17:06 vietj

@vietj hi! I couldn't find JsonObject#get or JsonArray#get with default values. Could you please provide more details? getOrDefault seems to be intuitive and it's called like this in JDK's Map UPDATE: okay, found JsonObject#getString.

privettoli avatar Jun 09 '20 17:06 privettoli

@vietj I will rename to get(String,String) but personally to me it's confusing.

privettoli avatar Jun 09 '20 17:06 privettoli

JsonObject has get*, getString, getValue, etc...

it might be confusing but then people used to JsonObject/JsonArray would be confused too :-)

On 9 Jun 2020, at 19:52, Anatolii Papenko [email protected] wrote:

@vietj https://github.com/vietj I will rename to get(String,String) but personally to me it's confusing.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eclipse-vertx/vert.x/pull/3439#issuecomment-641475203, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXDCWTYYNWJ63OJVBCONDRVZZHTANCNFSM4NZT6UUQ.

vietj avatar Jun 09 '20 17:06 vietj

@vietj done

privettoli avatar Jun 09 '20 23:06 privettoli

@vietj can we merge this?

privettoli avatar Jun 18 '20 01:06 privettoli

@privettoli sorry I had pending review for this and I just published now

vietj avatar Jun 18 '20 07:06 vietj