com.hazelcast.jet.datamodel

## Class ItemsByTag

- java.lang.Object
- - com.hazelcast.jet.datamodel.ItemsByTag

-     public final class ItemsByTag
      extends Object

  A heterogeneous map from `Tag<E>` to `E`, where `E` can be different for each tag. The value associated with a tag may be `null`.

  This is a less type-safe, but more flexible alternative to a tuple. The tuple has a fixed number of integer-indexed, statically-typed fields, and `ItemsByTag` has a variable number of tag-indexed fields whose whose static type is encoded in the tags.

  Since:
    3.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ItemsByTag()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `<E> E` | `get(Tag<E> tag)` Retrieves the value associated with the supplied tag and throws an exception if there is none.
    `int` | `hashCode()`
    `static ItemsByTag` | `itemsByTag(Object... tagsAndVals)` Accepts an argument list of alternating tags and values, interprets them as a list of tag-value pairs, and returns an `ItemsByTag` populated with these pairs.
    `<E> void` | `put(Tag<E> tag, E value)` Associates the supplied value with the supplied tag.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### ItemsByTag

          public ItemsByTag()

  - ### Method Detail

    - #### itemsByTag

          @Nonnull
          public static ItemsByTag itemsByTag(@Nonnull
                                                       Object... tagsAndVals)

      Accepts an argument list of alternating tags and values, interprets them as a list of tag-value pairs, and returns an `ItemsByTag` populated with these pairs.

    - #### get

          @Nullable
          public <E> E get(@Nonnull
                                     Tag<E> tag)

      Retrieves the value associated with the supplied tag and throws an exception if there is none. The tag argument must not be `null`, but the returned value may be, if a `null` value is explicitly associated with a tag.
      Throws:
        `IllegalArgumentException` - if there is no value associated with the supplied tag

    - #### put

          public <E> void put(@Nonnull
                              Tag<E> tag,
                              E value)

      Associates the supplied value with the supplied tag. The tag must not be `null`, but the value may be, and in that case the tag will be associated with a `null` value.

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2019. All rights reserved.