StormTuple implements backtype.storm.tuple.Tuple { @Override public byte[] getBinaryByField(final String field) { return getValueByName(field); } StormTuple(final IN flinkTuple, final Fields schema, final int producerTaskId, final String producerStreamId, final String producerComponentId, final MessageId messageId); @Override int size(); @Override boolean contains(final String field); @Override Fields getFields(); @Override int fieldIndex(final String field); @Override List<Object> select(final Fields selector); @Override Object getValue(final int i); @Override String getString(final int i); @Override Integer getInteger(final int i); @Override Long getLong(final int i); @Override Boolean getBoolean(final int i); @Override Short getShort(final int i); @Override Byte getByte(final int i); @Override Double getDouble(final int i); @Override Float getFloat(final int i); @Override byte[] getBinary(final int i); @SuppressWarnings("unchecked") T getValueByName(final String field); @Override Object getValueByField(final String field); @Override String getStringByField(final String field); @Override Integer getIntegerByField(final String field); @Override Long getLongByField(final String field); @Override Boolean getBooleanByField(final String field); @Override Short getShortByField(final String field); @Override Byte getByteByField(final String field); @Override Double getDoubleByField(final String field); @Override Float getFloatByField(final String field); @Override byte[] getBinaryByField(final String field); @Override List<Object> getValues(); @Override GlobalStreamId getSourceGlobalStreamid(); @Override String getSourceComponent(); @Override int getSourceTask(); @Override String getSourceStreamId(); @Override MessageId getMessageId(); @Override int hashCode(); @SuppressWarnings("rawtypes") @Override boolean equals(Object obj); @Override String toString();  }
@Test public void testGetBinaryByField() throws Exception { byte[] data = new byte[1 + r.nextInt(20)]; r.nextBytes(data); StormTuple<?> tuple = testGetByField(arity, index, data); Assert.assertSame(data, tuple.getBinaryByField(fieldName)); }
@Test public void testGetBinaryFieldPojo() throws Exception { byte[] data = new byte[1 + r.nextInt(20)]; r.nextBytes(data); TestPojoMember<byte[]> pojo = new TestPojoMember<byte[]>(data); StormTuple<TestPojoMember<byte[]>> tuple = new StormTuple<TestPojoMember<byte[]>>(pojo, null, -1, null, null, null); Assert.assertSame(data, tuple.getBinaryByField(fieldNamePojo)); }
@Test public void testGetBinaryByFieldPojoGetter() throws Exception { byte[] data = new byte[1 + r.nextInt(20)]; r.nextBytes(data); TestPojoGetter<byte[]> pojo = new TestPojoGetter<byte[]>(data); StormTuple<TestPojoGetter<byte[]>> tuple = new StormTuple<TestPojoGetter<byte[]>>(pojo, null, -1, null, null, null); Assert.assertSame(data, tuple.getBinaryByField(fieldNamePojo)); }