JavaPrimitive (Java Application API for IBM Streams)
Date: 2020-08-07

com.ibm.streamsx.topology.spl

## Class JavaPrimitive

- java.lang.Object
- - com.ibm.streamsx.topology.spl.JavaPrimitive

-     public class JavaPrimitive
      extends java.lang.Object

  Integration between Java topologies and SPL Java primitive operators.

  In addition to the usual Java types used for operator parameter values, a `Supplier<T>` parameter value may be specified. Submission time parameters are passed in this manner. See `Topology.createSubmissionParameter(String, Class)`. For example:

       Map<String,Object> params = ...
       params.put("aLong", topology.createSubmissionParameter(..., Long.class);
       params.put("aShort", topology.createSubmissionParameter(..., (short)13);
       ... = JavaPrimitive.invokeJavaPrimitive(..., params);

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `JavaPrimitive()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static SPLStream` | `invokeJavaPrimitive(java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass, SPLInput input, com.ibm.streams.operator.StreamSchema outputSchema, java.util.Map<java.lang.String,? extends java.lang.Object> params)` Create an SPLStream from the invocation of an SPL Java primitive operator with a single input port & output port.
    `static java.util.List<SPLStream>` | `invokeJavaPrimitive(TopologyElement te, java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass, java.util.List<? extends SPLInput> inputs, java.util.List<com.ibm.streams.operator.StreamSchema> outputSchemas, java.util.Map<java.lang.String,? extends java.lang.Object> params)` Invoke an SPL Java primitive operator with an arbitrary number of input and output ports.
    `static TSink` | `invokeJavaPrimitiveSink(java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass, SPLInput input, java.util.Map<java.lang.String,? extends java.lang.Object> params)` Invocation of a Java primitive operator that consumes a Stream.
    `static SPLStream` | `invokeJavaPrimitiveSource(TopologyElement te, java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass, com.ibm.streams.operator.StreamSchema schema, java.util.Map<java.lang.String,? extends java.lang.Object> params)` Invocation of a Java primitive source operator to produce a SPL Stream.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### JavaPrimitive

          public JavaPrimitive()

  - ### Method Detail

    - #### invokeJavaPrimitive

          public static SPLStream invokeJavaPrimitive(java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass,
                                                      SPLInput input,
                                                      com.ibm.streams.operator.StreamSchema outputSchema,
                                                      java.util.Map<java.lang.String,? extends java.lang.Object> params)

      Create an SPLStream from the invocation of an SPL Java primitive operator with a single input port & output port. The Java class `opClass` must be annotated with `PrimitiveOperator`.
      Parameters:
        `opClass` - Class of the operator to be invoked.
        `input` - Stream that will be connected to the only input port of the operator
        `outputSchema` - SPL schema of the operator's only output port.
        `params` - Parameters for the SPL Java Primitive operator, ignored if `null`.
      Returns:
        SPLStream the represents the output of the operator.

    - #### invokeJavaPrimitive

          public static java.util.List<SPLStream> invokeJavaPrimitive(TopologyElement te,
                                                                      java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass,
                                                                      java.util.List<? extends SPLInput> inputs,
                                                                      java.util.List<com.ibm.streams.operator.StreamSchema> outputSchemas,
                                                                      java.util.Map<java.lang.String,? extends java.lang.Object> params)

      Invoke an SPL Java primitive operator with an arbitrary number of input and output ports.
      Each input stream or window in `inputs` results in a input port for the operator with the input port index matching the position of the input in `inputs`. If `inputs` is `null` or empty then the operator will not have any input ports.
      Each SPL schema in `outputSchemas` an output port for the operator with the output port index matching the position of the schema in `outputSchemas`. If `outputSchemas` is `null` or empty then the operator will not have any output ports.
      Parameters:
        `te` - Reference to Topology the operator will be in.
        `opClass` - Class of the operator to be invoked.
        `inputs` - Input streams to be connected to the operator. May be `null` if no input streams are required.
        `outputSchemas` - Schemas of the output streams. May be `null` if no output streams are required.
        `params` - Parameters for the SPL Java Primitive operator, ignored if `null`.
      Returns:
        List of `SPLStream` instances that represent the outputs of the operator.

    - #### invokeJavaPrimitiveSink

          public static TSink invokeJavaPrimitiveSink(java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass,
                                                      SPLInput input,
                                                      java.util.Map<java.lang.String,? extends java.lang.Object> params)

      Invocation of a Java primitive operator that consumes a Stream.
      Parameters:
        `opClass` - Class of the operator to be invoked
        `input` - Stream that will be connected to the only input port of the operator
        `params` - Parameters for the SPL Java Primitive operator, ignored if `null`.

    - #### invokeJavaPrimitiveSource

          public static SPLStream invokeJavaPrimitiveSource(TopologyElement te,
                                                            java.lang.Class<? extends com.ibm.streams.operator.Operator> opClass,
                                                            com.ibm.streams.operator.StreamSchema schema,
                                                            java.util.Map<java.lang.String,? extends java.lang.Object> params)

      Invocation of a Java primitive source operator to produce a SPL Stream.
      Parameters:
        `te` - Reference to Topology the operator will be in.
        `opClass` - Class of the operator to be invoked.
        `schema` - Schema of the output port.
        `params` - Parameters for the SPL Java Primitive operator, ignored if `null`.
      Returns:
        SPLStream the represents the output of the operator.