Examples of JsonSet


Examples of com.github.jsonj.JsonSet

        }
        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

Examples of com.github.jsonj.JsonSet

     * 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

Examples of com.github.jsonj.JsonSet

    /**
     * @param elements {@link Number} instances
     * @return json array
     */
    public static JsonSet set(final Number... elements) {
        JsonSet jjArray = new JsonSet();
        for (Number n : elements) {
            jjArray.add(primitive(n));
        }
        return jjArray;
    }
View Full Code Here

Examples of com.github.jsonj.JsonSet

    public void shouldConvertPrimitiveProperlyOnFromObject() {
        assertThat(fromObject(primitive("42")), is((JsonElement)primitive("42")));
    }

    public void shouldCreateSet() {
        JsonSet set = set(1,2,3);
        assertThat(set, is(new JsonSet(Arrays.asList(1,2,3))));
        assertThat(set.size(), is(3));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.