Package com.github.jsonj

Examples of com.github.jsonj.JsonSet$IdStrategy


    /**
     * @return an empty JsonSet
     */
    public static JsonSet set() {
        return new JsonSet();
    }
View Full Code Here


    /**
     * @param elements elements
     * @return json set with all the elements added
     */
    public static JsonSet set(final JsonElement... elements) {
        JsonSet jjArray = new JsonSet();
        for (JsonElement jjElement : elements) {
            if(jjElement==null) {
                jjArray.add(nullValue());
            } else {
                jjArray.add(jjElement);
            }
        }
        return jjArray;
    }
View Full Code Here

     *
     * @param c an existing collection. If the elements are JsonElements, they will be added. Otherwise, primitive will be called on them.
     * @return json array with the collection elements in it
     */
    public static JsonSet set(Iterable<?> c) {
        JsonSet jjArray = new JsonSet();
        if(c instanceof JsonElement) {
            jjArray.add((JsonArray)c);
        } else {
            for (Object o : c) {
                if (o instanceof JsonElement) {
                    jjArray.add((JsonElement) o);
                } else {
                    jjArray.add(primitive(o));
                }
            }
        }
        return jjArray;
    }
View Full Code Here

    /**
     * @param elements strings
     * @return json array with all the elements added as JsonPrimitive
     */
    public static JsonSet set(final String... elements) {
        JsonSet jjSet = new JsonSet();
        for (String s : elements) {
            jjSet.add(primitive(s));
        }
        return jjSet;
    }
View Full Code Here

        }
        return jjSet;
    }

    public static <T> JsonSet set(T[] array) {
        JsonSet set = new JsonSet();
        for(T e: array) {
            set.add(fromObject(e));
        }
        return set;
    }
View Full Code Here

        }
        return set;
    }

    public static JsonSet set(int[] array) {
        JsonSet set = new JsonSet();
        for(int e: array) {
            set.add(e);
        }
        return set;
    }
View Full Code Here

        }
        return set;
    }

    public static JsonSet set(long[] array) {
        JsonSet set = new JsonSet();
        for(long e: array) {
            set.add(e);
        }
        return set;
    }
View Full Code Here

        }
        return set;
    }

    public static JsonSet set(float[] array) {
        JsonSet set = new JsonSet();
        for(float e: array) {
            set.add(e);
        }
        return set;
    }
View Full Code Here

        }
        return set;
    }

    public static JsonSet set(double[] array) {
        JsonSet set = new JsonSet();
        for(double e: array) {
            set.add(e);
        }
        return set;
    }
View Full Code Here

     * Allows you to add incomplete object builders without calling get()
     * @param elements json builders
     * @return json array with the builder objects
     */
    public static JsonSet set(final JsonBuilder... elements) {
        JsonSet jjArray = new JsonSet();
        for (JsonBuilder b : elements) {
            jjArray.add(b);
        }
        return jjArray;
    }
View Full Code Here

TOP

Related Classes of com.github.jsonj.JsonSet$IdStrategy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.