Search in sources :

Example 16 with JSONObject

use of com.ibm.json.java.JSONObject in project streamsx.topology by IBMStreams.

the class BOperator method complete.

@Override
public JSONObject complete() {
    JSONObject json = super.complete();
    if (regions != null) {
        JSONArray ra = new JSONArray();
        ra.addAll(regions);
        json.put("regions", ra);
    }
    return json;
}
Also used : JSONObject(com.ibm.json.java.JSONObject) JSONArray(com.ibm.json.java.JSONArray)

Example 17 with JSONObject

use of com.ibm.json.java.JSONObject in project streamsx.topology by IBMStreams.

the class BOutputPort method complete.

@Override
public JSONObject complete() {
    final JSONObject json = json();
    BUtils.addPortInfo(json, port);
    JSONArray conns = new JSONArray();
    for (StreamConnection c : port().getConnections()) {
        conns.add(c.getInput().getName());
    }
    json.put("connections", conns);
    return json;
}
Also used : JSONObject(com.ibm.json.java.JSONObject) JSONArray(com.ibm.json.java.JSONArray) StreamConnection(com.ibm.streams.flow.declare.StreamConnection)

Example 18 with JSONObject

use of com.ibm.json.java.JSONObject in project streamsx.topology by IBMStreams.

the class BOperatorInvocation method complete.

@Override
public JSONObject complete() {
    final JSONObject json = super.complete();
    if (outputs != null) {
        JSONArray oa = new JSONArray(outputs.size());
        for (BOutputPort output : outputs) {
            oa.add(output.complete());
        }
        json.put("outputs", oa);
    }
    if (inputs != null) {
        JSONArray ia = new JSONArray(inputs.size());
        for (BInputPort input : inputs) {
            ia.add(input.complete());
        }
        json.put("inputs", ia);
    }
    return json;
}
Also used : JSONObject(com.ibm.json.java.JSONObject) JSONArray(com.ibm.json.java.JSONArray)

Example 19 with JSONObject

use of com.ibm.json.java.JSONObject in project streamsx.topology by IBMStreams.

the class SPLValue method getMetaType.

private static MetaType getMetaType(JSONObject jo) {
    JSONObject value = (JSONObject) jo.get("value");
    String metaType = (String) value.get("metaType");
    return MetaType.valueOf(metaType);
}
Also used : JSONObject(com.ibm.json.java.JSONObject)

Example 20 with JSONObject

use of com.ibm.json.java.JSONObject in project streamsx.topology by IBMStreams.

the class SPLValue method getWrappedValue.

private static Object getWrappedValue(JSONObject jo) {
    JSONObject value = (JSONObject) jo.get("value");
    Object wrappedValue = value.get("value");
    return wrappedValue;
}
Also used : JSONObject(com.ibm.json.java.JSONObject) JSONObject(com.ibm.json.java.JSONObject)

Aggregations

JSONObject (com.ibm.json.java.JSONObject)56 JSONArray (com.ibm.json.java.JSONArray)19 Topology (com.ibm.streamsx.topology.Topology)18 Test (org.junit.Test)18 TestTopology (com.ibm.streamsx.topology.test.TestTopology)14 SPLStream (com.ibm.streamsx.topology.spl.SPLStream)6 Tester (com.ibm.streamsx.topology.tester.Tester)5 JsonObject (com.google.gson.JsonObject)4 HashMap (java.util.HashMap)4 Random (java.util.Random)4 ArrayList (java.util.ArrayList)3 List (java.util.List)3 OrderedJSONObject (com.ibm.json.java.OrderedJSONObject)2 StreamConnection (com.ibm.streams.flow.declare.StreamConnection)2 StreamSchema (com.ibm.streams.operator.StreamSchema)2 BOperatorInvocation (com.ibm.streamsx.topology.builder.BOperatorInvocation)2 File (java.io.File)2 IOException (java.io.IOException)2 Map (java.util.Map)2 Attribute (com.ibm.streams.operator.Attribute)1