Package org.apache.storm.trident.tuple
Class TridentTupleView
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<Object>
-
- org.apache.storm.trident.tuple.TridentTupleView
-
- All Implemented Interfaces:
Iterable<Object>
,Collection<Object>
,List<Object>
,TridentTuple
,ITuple
public class TridentTupleView extends AbstractList<Object> implements TridentTuple
Extends AbstractList so that it can be emitted directly as Storm tuples.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TridentTupleView.FreshOutputFactory
static class
TridentTupleView.OperationOutputFactory
static class
TridentTupleView.ProjectionFactory
static class
TridentTupleView.RootFactory
-
Nested classes/interfaces inherited from interface org.apache.storm.trident.tuple.TridentTuple
TridentTuple.Factory
-
-
Field Summary
Fields Modifier and Type Field Description static TridentTupleView
EMPTY_TUPLE
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description TridentTupleView(List delegates, ValuePointer[] index, Map<String,ValuePointer> fieldIndex)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(String field)
Returns true if this tuple contains the specified name of the field.static TridentTuple
createFreshTuple(Fields fields, Object... values)
static TridentTuple
createFreshTuple(Fields fields, List<Object> values)
int
fieldIndex(String field)
Returns the position of the specified field in this tuple.Object
get(int i)
byte[]
getBinary(int i)
Returns the byte array at position i in the tuple.byte[]
getBinaryByField(String field)
Gets the Byte array field with a specific name.Boolean
getBoolean(int i)
Returns the Boolean at position i in the tuple.Boolean
getBooleanByField(String field)
Gets the Boolean field with a specific name.Byte
getByte(int i)
Returns the Byte at position i in the tuple.Byte
getByteByField(String field)
Gets the Byte field with a specific name.Double
getDouble(int i)
Returns the Double at position i in the tuple.Double
getDoubleByField(String field)
Gets the Double field with a specific name.Fields
getFields()
Gets the names of the fields in this tuple.Float
getFloat(int i)
Returns the Float at position i in the tuple.Float
getFloatByField(String field)
Gets the Float field with a specific name.Integer
getInteger(int i)
Returns the Integer at position i in the tuple.Integer
getIntegerByField(String field)
Gets the Integer field with a specific name.Long
getLong(int i)
Returns the Long at position i in the tuple.Long
getLongByField(String field)
Gets the Long field with a specific name.Short
getShort(int i)
Returns the Short at position i in the tuple.Short
getShortByField(String field)
Gets the Short field with a specific name.String
getString(int i)
Returns the String at position i in the tuple.String
getStringByField(String field)
Gets the String field with a specific name.Object
getValue(int i)
Gets the field at position i in the tuple.Object
getValueByField(String field)
Gets the field with a specific name.List<Object>
getValues()
Gets all the values in this tuple.List<Object>
select(Fields selector)
Returns a subset of the tuple based on the fields selector.int
size()
Returns the number of fields in this tuple.-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, sort, spliterator, subList, toArray, toArray
-
-
-
-
Field Detail
-
EMPTY_TUPLE
public static final TridentTupleView EMPTY_TUPLE
-
-
Constructor Detail
-
TridentTupleView
public TridentTupleView(List delegates, ValuePointer[] index, Map<String,ValuePointer> fieldIndex)
-
-
Method Detail
-
createFreshTuple
public static TridentTuple createFreshTuple(Fields fields, List<Object> values)
-
createFreshTuple
public static TridentTuple createFreshTuple(Fields fields, Object... values)
-
getValues
public List<Object> getValues()
Description copied from interface:ITuple
Gets all the values in this tuple.
-
size
public int size()
Description copied from interface:ITuple
Returns the number of fields in this tuple.
-
contains
public boolean contains(String field)
Description copied from interface:ITuple
Returns true if this tuple contains the specified name of the field.
-
getFields
public Fields getFields()
Description copied from interface:ITuple
Gets the names of the fields in this tuple.
-
fieldIndex
public int fieldIndex(String field)
Description copied from interface:ITuple
Returns the position of the specified field in this tuple.- Specified by:
fieldIndex
in interfaceITuple
-
select
public List<Object> select(Fields selector)
Description copied from interface:ITuple
Returns a subset of the tuple based on the fields selector.
-
get
public Object get(int i)
-
getValue
public Object getValue(int i)
Description copied from interface:ITuple
Gets the field at position i in the tuple. Returns object since tuples are dynamically typed.
-
getString
public String getString(int i)
Description copied from interface:ITuple
Returns the String at position i in the tuple.
-
getInteger
public Integer getInteger(int i)
Description copied from interface:ITuple
Returns the Integer at position i in the tuple.- Specified by:
getInteger
in interfaceITuple
-
getLong
public Long getLong(int i)
Description copied from interface:ITuple
Returns the Long at position i in the tuple.
-
getBoolean
public Boolean getBoolean(int i)
Description copied from interface:ITuple
Returns the Boolean at position i in the tuple.- Specified by:
getBoolean
in interfaceITuple
-
getShort
public Short getShort(int i)
Description copied from interface:ITuple
Returns the Short at position i in the tuple.
-
getByte
public Byte getByte(int i)
Description copied from interface:ITuple
Returns the Byte at position i in the tuple.
-
getDouble
public Double getDouble(int i)
Description copied from interface:ITuple
Returns the Double at position i in the tuple.
-
getFloat
public Float getFloat(int i)
Description copied from interface:ITuple
Returns the Float at position i in the tuple.
-
getBinary
public byte[] getBinary(int i)
Description copied from interface:ITuple
Returns the byte array at position i in the tuple.
-
getValueByField
public Object getValueByField(String field)
Description copied from interface:ITuple
Gets the field with a specific name. Returns object since tuples are dynamically typed.- Specified by:
getValueByField
in interfaceITuple
-
getStringByField
public String getStringByField(String field)
Description copied from interface:ITuple
Gets the String field with a specific name.- Specified by:
getStringByField
in interfaceITuple
-
getIntegerByField
public Integer getIntegerByField(String field)
Description copied from interface:ITuple
Gets the Integer field with a specific name.- Specified by:
getIntegerByField
in interfaceITuple
-
getLongByField
public Long getLongByField(String field)
Description copied from interface:ITuple
Gets the Long field with a specific name.- Specified by:
getLongByField
in interfaceITuple
-
getBooleanByField
public Boolean getBooleanByField(String field)
Description copied from interface:ITuple
Gets the Boolean field with a specific name.- Specified by:
getBooleanByField
in interfaceITuple
-
getShortByField
public Short getShortByField(String field)
Description copied from interface:ITuple
Gets the Short field with a specific name.- Specified by:
getShortByField
in interfaceITuple
-
getByteByField
public Byte getByteByField(String field)
Description copied from interface:ITuple
Gets the Byte field with a specific name.- Specified by:
getByteByField
in interfaceITuple
-
getDoubleByField
public Double getDoubleByField(String field)
Description copied from interface:ITuple
Gets the Double field with a specific name.- Specified by:
getDoubleByField
in interfaceITuple
-
getFloatByField
public Float getFloatByField(String field)
Description copied from interface:ITuple
Gets the Float field with a specific name.- Specified by:
getFloatByField
in interfaceITuple
-
getBinaryByField
public byte[] getBinaryByField(String field)
Description copied from interface:ITuple
Gets the Byte array field with a specific name.- Specified by:
getBinaryByField
in interfaceITuple
-
-