Skip to content

Conversation

kunaljani1100
Copy link
Contributor

Motivation:

Currently the static method JsonObject.of() method has 10 different definitions to accept key value pairs as parameters to create a new JSON object. The new implementation of this method intends to ensure that we do not need 10 different definitions based on the number of parameters to create a JSON object. Instead, the new method implements an array of map entries (tuples) that consists of a key and a value corresponding to the key. It is possible to have multiple such map entries, so instead of defining the of() method 10 times, this method should be declared only once with the ability to process a variable number of arguments.

Conformance:

You should have signed the Eclipse Contributor Agreement as explained in https://github.com/eclipse/vert.x/blob/master/CONTRIBUTING.md

I have signed the Eclipse Contributor Agreement.

Please also make sure you adhere to the code style guidelines: https://github.com/vert-x3/wiki/wiki/Vert.x-code-style-guidelines

I am adhering to the code style guidelines.

@vietj
Copy link
Member

vietj commented Oct 2, 2025

what is the purpose of this ?

@kunaljani1100
Copy link
Contributor Author

We do not want to have 10 separate declarations of methods when it is possible to declare a single method that can accept a variable number of arguments.

@vietj
Copy link
Member

vietj commented Oct 6, 2025

I mean what is the purpose of using map.entry while vertx already have the same method with key/value ?

@kunaljani1100
Copy link
Contributor Author

When we want to create a JSON object with a large number of entries, such as 12 or more entries, the functions that have been already defined would not be able to accommodate these changes, so we will need to use a map.entry object when there are a large number of key value pairs that we want to add to our JSON object.

@vietj
Copy link
Member

vietj commented Oct 8, 2025

it seems very specific to your case and does not add much, I think you can make your own static method for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants