Examples of optLong()


Examples of net.sf.json.JSONArray.optLong()

                if (array != null)
                {
                    List<Long> ids = new ArrayList<Long>();
                    for (int i = 0; i < array.size(); i++)
                    {
                        long id = array.optLong(i, -1);
                        if (id >= 0)
                        {
                            ids.add(id);
                        }
                    }
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optLong()

        final JSONObject params;
        try {
            params = new JSONObject(request.getParameter("params"));

            final long interval = params.optLong(BulkWorkflowEngine.KEY_INTERVAL, -1);

            if (interval < 1) {
                bulkWorkflowEngine.resume(request.getResource());
            } else {
                bulkWorkflowEngine.resume(request.getResource(), interval);
View Full Code Here

Examples of org.apache.sling.commons.json.JSONObject.optLong()

            map.put(BulkWorkflowEngine.KEY_BATCH_TIMEOUT,
                    params.optInt(BulkWorkflowEngine.KEY_BATCH_TIMEOUT, BulkWorkflowEngine.DEFAULT_BATCH_TIMEOUT));

            map.put(BulkWorkflowEngine.KEY_ESTIMATED_TOTAL,
                    params.optLong(BulkWorkflowEngine.KEY_ESTIMATED_TOTAL, BulkWorkflowEngine.DEFAULT_ESTIMATED_TOTAL));

            map.put(BulkWorkflowEngine.KEY_PURGE_WORKFLOW,
                    params.optBoolean(BulkWorkflowEngine.KEY_PURGE_WORKFLOW,
                            BulkWorkflowEngine.DEFAULT_PURGE_WORKFLOW));
View Full Code Here

Examples of org.apache.wink.json4j.JSONObject.optLong()

    public void test_optLong() {
        Exception ex = null;

        try {
            JSONObject jObject = new JSONObject("{\"long\":1}");
            assertTrue(jObject.optLong("long") == 1);
            assertTrue(jObject.optLong("long2", 2) == 2);
            assertTrue(jObject.optLong("long2") == 0);
        } catch (Exception ex1) {
            ex = ex1;
            ex.printStackTrace();
View Full Code Here

Examples of org.apache.wink.json4j.JSONObject.optLong()

        Exception ex = null;

        try {
            JSONObject jObject = new JSONObject("{\"long\":1}");
            assertTrue(jObject.optLong("long") == 1);
            assertTrue(jObject.optLong("long2", 2) == 2);
            assertTrue(jObject.optLong("long2") == 0);
        } catch (Exception ex1) {
            ex = ex1;
            ex.printStackTrace();
        }
View Full Code Here

Examples of org.apache.wink.json4j.JSONObject.optLong()

        try {
            JSONObject jObject = new JSONObject("{\"long\":1}");
            assertTrue(jObject.optLong("long") == 1);
            assertTrue(jObject.optLong("long2", 2) == 2);
            assertTrue(jObject.optLong("long2") == 0);
        } catch (Exception ex1) {
            ex = ex1;
            ex.printStackTrace();
        }
        assertTrue(ex == null);
View Full Code Here

Examples of org.apache.wink.json4j.JSONObject.optLong()

    public void test_optLongNgative() {
        Exception ex = null;

        try {
            JSONObject jObject = new JSONObject("{\"long\":-1}");
            assertTrue(jObject.optLong("long") == -1);
        } catch (Exception ex1) {
            ex = ex1;
            ex.printStackTrace();
        }
        assertTrue(ex == null);
View Full Code Here

Examples of org.codehaus.jettison.json.JSONObject.optLong()

        if (null != edges) {
            for (int i = 0; i < edges.length(); i++) {
                final JSONObject edge = edges.optJSONObject(i);
                FaunusEdge faunusEdge = null;
                if (direction.equals(Direction.IN)) {
                    faunusEdge = (FaunusEdge) graphson.edgeFromJson(edge, new FaunusVertex(edge.optLong(GraphSONTokens._OUT_V)), vertex);
                } else if (direction.equals(Direction.OUT)) {
                    faunusEdge = (FaunusEdge) graphson.edgeFromJson(edge, vertex, new FaunusVertex(edge.optLong(GraphSONTokens._IN_V)));
                }

                if (faunusEdge != null) {
View Full Code Here

Examples of org.codehaus.jettison.json.JSONObject.optLong()

                final JSONObject edge = edges.optJSONObject(i);
                FaunusEdge faunusEdge = null;
                if (direction.equals(Direction.IN)) {
                    faunusEdge = (FaunusEdge) graphson.edgeFromJson(edge, new FaunusVertex(edge.optLong(GraphSONTokens._OUT_V)), vertex);
                } else if (direction.equals(Direction.OUT)) {
                    faunusEdge = (FaunusEdge) graphson.edgeFromJson(edge, vertex, new FaunusVertex(edge.optLong(GraphSONTokens._IN_V)));
                }

                if (faunusEdge != null) {
                    vertex.addEdge(direction, faunusEdge);
                }
View Full Code Here

Examples of org.codehaus.jettison.json.JSONObject.optLong()

        try {
            final HttpURLConnection connection = HttpHelper.createConnection(
                    this.getRestCountEndpoint(), this.getAuthenticationHeaderValue());
            final JSONObject json = new JSONObject(convertStreamToString(connection.getInputStream()));

            return json.optLong(FaunusRexsterInputFormatExtension.EXTENSION_METHOD_COUNT);
        } catch (Exception e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }
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.