添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is your feature request related to a problem? Please describe.
Currently, we could add / insert values to ArrayNode instance. but the set method only accepts JsonNode instance.

Describe the solution you'd like
It would be nice if we have set methods like add / insert

Usage example

ArrayNode arr = getNewArrayNode();
arr.add("a");
arr.insert(0, "b");
arr.set(0, "c");        // <------- Missing

Additional context

Sounds reasonable. I think it should probably follow example of ObjectNode.put() so that:

  • A wide variety of types are supported (and esp. important is primitive-and-wrapper variants)
  • Returns ObjectNode ( this ) to allow call chaining.
  • On (1), no need to add setObject() , I think (since there is already set(index, JsonNode) ) -- but need to add setPOJO(index, pojo) -- this since there is bit of confusion otherwise on what "Object" means; here it MUST mean ObjectNode , and not general Java Object (hence "POJO").
  • It might also make sense to post on jackson-dev google group to ask for input: this makes sense to me but others might be able to offer comments.

    Also: needs to go in 2.13 branch, being feature add.