Package org.apache.storm.tuple
Interface ITuple
- All Known Subinterfaces:
TridentTuple,Tuple
- All Known Implementing Classes:
ClojureTuple,TridentTupleView,TupleImpl
public interface ITuple
-
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns true if this tuple contains the specified name of the field.intfieldIndex(String field) Returns the position of the specified field in this tuple.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.getBoolean(int i) Returns the Boolean at position i in the tuple.getBooleanByField(String field) Gets the Boolean field with a specific name.getByte(int i) Returns the Byte at position i in the tuple.getByteByField(String field) Gets the Byte field with a specific name.getDouble(int i) Returns the Double at position i in the tuple.getDoubleByField(String field) Gets the Double field with a specific name.Gets the names of the fields in this tuple.getFloat(int i) Returns the Float at position i in the tuple.getFloatByField(String field) Gets the Float field with a specific name.getInteger(int i) Returns the Integer at position i in the tuple.getIntegerByField(String field) Gets the Integer field with a specific name.getLong(int i) Returns the Long at position i in the tuple.getLongByField(String field) Gets the Long field with a specific name.getShort(int i) Returns the Short at position i in the tuple.getShortByField(String field) Gets the Short field with a specific name.getString(int i) Returns the String at position i in the tuple.getStringByField(String field) Gets the String field with a specific name.getValue(int i) Gets the field at position i in the tuple.getValueByField(String field) Gets the field with a specific name.Gets all the values in this tuple.Returns a subset of the tuple based on the fields selector.intsize()Returns the number of fields in this tuple.
-
Method Details
-
size
int size()Returns the number of fields in this tuple. -
contains
Returns true if this tuple contains the specified name of the field. -
getFields
Fields getFields()Gets the names of the fields in this tuple. -
fieldIndex
Returns the position of the specified field in this tuple.- Throws:
IllegalArgumentException- - if field does not exist
-
select
Returns a subset of the tuple based on the fields selector. -
getValue
Gets the field at position i in the tuple. Returns object since tuples are dynamically typed.- Throws:
IndexOutOfBoundsException- - if the index is out of range `(index < 0 || index >= size())`
-
getString
Returns the String at position i in the tuple.- Throws:
ClassCastException- If that field is not a StringIndexOutOfBoundsException- - if the index is out of range `(index < 0 || index >= size())`
-
getInteger
Returns the Integer at position i in the tuple.- Throws:
ClassCastException- If that field is not a IntegerIndexOutOfBoundsException- - if the index is out of range `(index < 0 || index >= size())`
-
getLong
Returns the Long at position i in the tuple.- Throws:
ClassCastException- If that field is not a LongIndexOutOfBoundsException- - if the index is out of range `(index < 0 || index >= size())`
-
getBoolean
Returns the Boolean at position i in the tuple.- Throws:
ClassCastException- If that field is not a BooleanIndexOutOfBoundsException- - if the index is out of range `(index < 0 || index >= size())`
-
getShort
Returns the Short at position i in the tuple.- Throws:
ClassCastException- If that field is not a ShortIndexOutOfBoundsException- - if the index is out of range `(index < 0 || index >= size())`
-
getByte
Returns the Byte at position i in the tuple.- Throws:
ClassCastException- If that field is not a ByteIndexOutOfBoundsException- - if the index is out of range `(index < 0 || index >= size())`
-
getDouble
Returns the Double at position i in the tuple.- Throws:
ClassCastException- If that field is not a DoubleIndexOutOfBoundsException- - if the index is out of range `(index < 0 || index >= size())`
-
getFloat
Returns the Float at position i in the tuple.- Throws:
ClassCastException- If that field is not a FloatIndexOutOfBoundsException- - if the index is out of range `(index < 0 || index >= size())`
-
getBinary
byte[] getBinary(int i) Returns the byte array at position i in the tuple.- Throws:
ClassCastException- If that field is not a byte arrayIndexOutOfBoundsException- - if the index is out of range `(index < 0 || index >= size())`
-
getValueByField
Gets the field with a specific name. Returns object since tuples are dynamically typed.- Throws:
IllegalArgumentException- - if field does not exist
-
getStringByField
Gets the String field with a specific name.- Throws:
ClassCastException- If that field is not a StringIllegalArgumentException- - if field does not exist
-
getIntegerByField
Gets the Integer field with a specific name.- Throws:
ClassCastException- If that field is not an IntegerIllegalArgumentException- - if field does not exist
-
getLongByField
Gets the Long field with a specific name.- Throws:
ClassCastException- If that field is not a LongIllegalArgumentException- - if field does not exist
-
getBooleanByField
Gets the Boolean field with a specific name.- Throws:
ClassCastException- If that field is not a BooleanIllegalArgumentException- - if field does not exist
-
getShortByField
Gets the Short field with a specific name.- Throws:
ClassCastException- If that field is not a ShortIllegalArgumentException- - if field does not exist
-
getByteByField
Gets the Byte field with a specific name.- Throws:
ClassCastException- If that field is not a ByteIllegalArgumentException- - if field does not exist
-
getDoubleByField
Gets the Double field with a specific name.- Throws:
ClassCastException- If that field is not a DoubleIllegalArgumentException- - if field does not exist
-
getFloatByField
Gets the Float field with a specific name.- Throws:
ClassCastException- If that field is not a FloatIllegalArgumentException- - if field does not exist
-
getBinaryByField
Gets the Byte array field with a specific name.- Throws:
ClassCastException- If that field is not a byte arrayIllegalArgumentException- - if field does not exist
-
getValues
Gets all the values in this tuple.
-