Class Fields

java.lang.Object
org.apache.storm.tuple.Fields
All Implemented Interfaces:
Serializable, Iterable<String>

public class Fields extends Object implements Iterable<String>, Serializable
Collection of unique named fields using in an ITuple.
See Also:
  • Constructor Details

    • Fields

      public Fields(String... fields)
    • Fields

      public Fields(List<String> fields)
  • Method Details

    • select

      public List<Object> select(Fields selector, List<Object> tuple)
      Select values out of tuple given a Fields selector Note that this function can throw a NullPointerException if the fields in selector are not found in the index.
      Parameters:
      selector - Fields to select
      tuple - tuple to select from
    • toList

      public List<String> toList()
    • size

      public int size()
      Returns the number of fields in this collection.
    • get

      public String get(int index)
      Gets the field at position index in the collection.
      Parameters:
      index - index of the field to return
      Throws:
      IndexOutOfBoundsException - - if the index is out of range (index < 0 || index >= size())
    • iterator

      public Iterator<String> iterator()
      Specified by:
      iterator in interface Iterable<String>
    • fieldIndex

      public int fieldIndex(String field)
      Returns the position of the specified named field.
      Parameters:
      field - Named field to evaluate
      Throws:
      IllegalArgumentException - - if field does not exist
    • contains

      public boolean contains(String field)
      Check contains.
      Returns:
      true if this contains the specified name of the field.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object