org.apache.storm.tuple

## Interface ITuple

- All Known Subinterfaces:
    TridentTuple, Tuple
  All Known Implementing Classes:
    ClojureTuple, SimpleTuple, TridentTupleView, TupleImpl

      public interface ITuple

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `contains(String field)` Returns true if this tuple contains the specified name of the field.
    `int` | `fieldIndex(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.
    `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.

- - ### Method Detail

    - #### size

          int size()

      Returns the number of fields in this tuple.

    - #### contains

          boolean contains(String field)

      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

          int fieldIndex(String field)

      Returns the position of the specified field in this tuple.

      Throws:
        `IllegalArgumentException` -
        - if field does not exist

    - #### select

          List<Object> select(Fields selector)

      Returns a subset of the tuple based on the fields selector.

    - #### getValue

          Object getValue(int i)

      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

          String getString(int i)

      Returns the String at position i in the tuple.

      Throws:
        `ClassCastException` - If that field is not a String
        `IndexOutOfBoundsException` -
        - if the index is out of range `(index < 0 || index >= size())`

    - #### getInteger

          Integer getInteger(int i)

      Returns the Integer at position i in the tuple.

      Throws:
        `ClassCastException` - If that field is not a Integer
        `IndexOutOfBoundsException` -
        - if the index is out of range `(index < 0 || index >= size())`

    - #### getLong

          Long getLong(int i)

      Returns the Long at position i in the tuple.

      Throws:
        `ClassCastException` - If that field is not a Long
        `IndexOutOfBoundsException` -
        - if the index is out of range `(index < 0 || index >= size())`

    - #### getBoolean

          Boolean getBoolean(int i)

      Returns the Boolean at position i in the tuple.

      Throws:
        `ClassCastException` - If that field is not a Boolean
        `IndexOutOfBoundsException` -
        - if the index is out of range `(index < 0 || index >= size())`

    - #### getShort

          Short getShort(int i)

      Returns the Short at position i in the tuple.

      Throws:
        `ClassCastException` - If that field is not a Short
        `IndexOutOfBoundsException` -
        - if the index is out of range `(index < 0 || index >= size())`

    - #### getByte

          Byte getByte(int i)

      Returns the Byte at position i in the tuple.

      Throws:
        `ClassCastException` - If that field is not a Byte
        `IndexOutOfBoundsException` -
        - if the index is out of range `(index < 0 || index >= size())`

    - #### getDouble

          Double getDouble(int i)

      Returns the Double at position i in the tuple.

      Throws:
        `ClassCastException` - If that field is not a Double
        `IndexOutOfBoundsException` -
        - if the index is out of range `(index < 0 || index >= size())`

    - #### getFloat

          Float getFloat(int i)

      Returns the Float at position i in the tuple.

      Throws:
        `ClassCastException` - If that field is not a Float
        `IndexOutOfBoundsException` -
        - 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 array
        `IndexOutOfBoundsException` -
        - if the index is out of range `(index < 0 || index >= size())`

    - #### getValueByField

          Object getValueByField(String field)

      Gets the field with a specific name. Returns object since tuples are dynamically typed.

      Throws:
        `IllegalArgumentException` -
        - if field does not exist

    - #### getStringByField

          String getStringByField(String field)

      Gets the String field with a specific name.

      Throws:
        `ClassCastException` - If that field is not a String
        `IllegalArgumentException` -
        - if field does not exist

    - #### getIntegerByField

          Integer getIntegerByField(String field)

      Gets the Integer field with a specific name.

      Throws:
        `ClassCastException` - If that field is not an Integer
        `IllegalArgumentException` -
        - if field does not exist

    - #### getLongByField

          Long getLongByField(String field)

      Gets the Long field with a specific name.

      Throws:
        `ClassCastException` - If that field is not a Long
        `IllegalArgumentException` -
        - if field does not exist

    - #### getBooleanByField

          Boolean getBooleanByField(String field)

      Gets the Boolean field with a specific name.

      Throws:
        `ClassCastException` - If that field is not a Boolean
        `IllegalArgumentException` -
        - if field does not exist

    - #### getShortByField

          Short getShortByField(String field)

      Gets the Short field with a specific name.

      Throws:
        `ClassCastException` - If that field is not a Short
        `IllegalArgumentException` -
        - if field does not exist

    - #### getByteByField

          Byte getByteByField(String field)

      Gets the Byte field with a specific name.

      Throws:
        `ClassCastException` - If that field is not a Byte
        `IllegalArgumentException` -
        - if field does not exist

    - #### getDoubleByField

          Double getDoubleByField(String field)

      Gets the Double field with a specific name.

      Throws:
        `ClassCastException` - If that field is not a Double
        `IllegalArgumentException` -
        - if field does not exist

    - #### getFloatByField

          Float getFloatByField(String field)

      Gets the Float field with a specific name.

      Throws:
        `ClassCastException` - If that field is not a Float
        `IllegalArgumentException` -
        - if field does not exist

    - #### getBinaryByField

          byte[] getBinaryByField(String field)

      Gets the Byte array field with a specific name.

      Throws:
        `ClassCastException` - If that field is not a byte array
        `IllegalArgumentException` -
        - if field does not exist

    - #### getValues

          List<Object> getValues()

      Gets all the values in this tuple.

Copyright © 2021 The Apache Software Foundation. All rights reserved.