Java Json Get getJsonIntArray(Iterable integers)

Here you can find the source of getJsonIntArray(Iterable integers)

Description

get Json Int Array

License

Apache License

Declaration

public static JsonArray getJsonIntArray(Iterable<Integer> integers) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import javax.json.Json;
import javax.json.JsonArray;
import javax.json.JsonArrayBuilder;

public class Main {

    public static JsonArray getJsonIntArray(Iterable<Integer> integers) {
        JsonArrayBuilder builder = Json.createArrayBuilder();

        for (int i : integers) {
            builder.add(i);/*from   ww  w.j  av a  2 s  .  c  o m*/
        }

        return builder.build();
    }
}

Related

  1. getInt(JsonObject json, String name)
  2. getIntArray(JsonObject object, String name)
  3. getIntegerArrayList(JsonArray array)
  4. getIntegerArrayListSansDoublons( JsonArray array)
  5. getJsonArray(JsonObject object, String name)
  6. getJsonNumberOrNull(JsonObject object, String key)
  7. getJsonObject(JsonObject object, String name)
  8. getJsonValue(String json_path, JsonObject response)
  9. getKeyAsString(JsonObject obj, String key, String defaultValue)