Package com.streambase.sb.unittest
Class ObjectArrayTupleMaker
java.lang.Object
com.streambase.sb.unittest.AbstractTupleMaker<Object[]>
com.streambase.sb.unittest.ObjectArrayTupleMaker
- All Implemented Interfaces:
TupleMaker<Object[]>
A factory to build
Tuple
s from Java objects. Accepts the same objects as
Tuple.setField(com.streambase.sb.Schema.Field, Object)
.
Note that when passing Tuple
s as value objects to an Enqueuer
or Dequeuer
,
you may obtain the stream's schema from Enqueuer.getSchema()
and Dequeuer.getSchema()
For example, given a schema:
id int, name string, values list(int), listofvalues list(list(int)), location tuple(zipcode int, state string), prevlocation tuple(zipcode int, state string)a valid invocation of
createTuple(Schema, Object[])
might look like:
createTuple(schema, new Object[] { 1, "item1", Arrays.asList(10,20), "[\"[30,40]\",\"[50,60]\"]", "2421, MA", s.getField(5).getSchema().createTuple("10036", "NY") });
- Since:
- 6.6
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ObjectArrayTupleMaker
StaticObjectArrayTupleMaker
instance suitable as argument toEnqueuer
andExpecter
methods that need aTupleMaker
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateTuple
(Schema schema, Object[] objs) create aTuple
s from an input objectMethods inherited from class com.streambase.sb.unittest.AbstractTupleMaker
createTuples, createTuples
-
Field Details
-
MAKER
StaticObjectArrayTupleMaker
instance suitable as argument toEnqueuer
andExpecter
methods that need aTupleMaker
- See Also:
-
-
Constructor Details
-
ObjectArrayTupleMaker
public ObjectArrayTupleMaker()
-
-
Method Details
-
createTuple
Description copied from interface:TupleMaker
create aTuple
s from an input object- Specified by:
createTuple
in interfaceTupleMaker<Object[]>
- Specified by:
createTuple
in classAbstractTupleMaker<Object[]>
- Parameters:
schema
- the schema for the tupleobjs
- the input data to build it from- Returns:
- the result tuple
- Throws:
StreamBaseException
- Error creating tuple
-