com.hazelcast.jet.datamodel

## Class Tag<T>

- java.lang.Object
- - com.hazelcast.jet.datamodel.Tag<T>

- Type Parameters:
    `T` - the type of the data associated with the tag
  All Implemented Interfaces:
    Serializable, Comparable<Tag<?>>

      public final class Tag<T>
      extends Object
      implements Comparable<Tag<?>>, Serializable

  A tag object useful as a key in heterogeneous maps. Carries static type information in its type parameter, which is expected to correspond to the type of the item retrieved from the map.

  Tags are also used by hash-join and co-group builder objects. The same tag supplied to the builder is used to retrieve the data from the heterogeneous maps (`ItemsByTag`) that appear in the output.

  Since:
    3.0
  See Also:
    Serialized Form

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(Tag<?> that)`
    `boolean` | `equals(Object obj)`
    `int` | `hashCode()`
    `int` | `index()` Returns the index associated with this tag.
    `static <T> Tag<T>` | `tag(int index)` Returns a tag object associated with the specified index.
    `static <T> Tag<T>` | `tag0()` Returns the tag constant `TAG_0`.
    `static <T> Tag<T>` | `tag1()` Returns the tag constant `TAG_1`.
    `static <T> Tag<T>` | `tag2()` Returns the tag constant `TAG_2`.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### tag

          public static <T> Tag<T> tag(int index)

      Returns a tag object associated with the specified index. The tag's type parameter is inferred from the call site. The method will not necessarily create a new tag object.

    - #### index

          public int index()

      Returns the index associated with this tag. It can refer to the index of a contributing stream in a hash-join or co-group operation, or to the index used internally to store the data associated with the tag.

    - #### tag0

          public static <T> Tag<T> tag0()

      Returns the tag constant `TAG_0`.

    - #### tag1

          public static <T> Tag<T> tag1()

      Returns the tag constant `TAG_1`.

    - #### tag2

          public static <T> Tag<T> tag2()

      Returns the tag constant `TAG_2`.

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### compareTo

          public int compareTo(Tag<?> that)

      Specified by:
        `compareTo` in interface `Comparable<Tag<?>>`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2019. All rights reserved.