Package com.hazelcast.jet.datamodel
Class ItemsByTag
java.lang.Object
com.hazelcast.jet.datamodel.ItemsByTag
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:
- Jet 3.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
<E> E
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 anItemsByTag
populated with these pairs.<E> void
Associates the supplied value with the supplied tag.toString()
-
Constructor Details
-
ItemsByTag
public ItemsByTag()
-
-
Method Details
-
itemsByTag
Accepts an argument list of alternating tags and values, interprets them as a list of tag-value pairs, and returns anItemsByTag
populated with these pairs. -
get
Retrieves the value associated with the supplied tag and throws an exception if there is none. The tag argument must not benull
, but the returned value may be, if anull
value is explicitly associated with a tag.- Throws:
IllegalArgumentException
- if there is no value associated with the supplied tag
-
put
Associates the supplied value with the supplied tag. The tag must not benull
, but the value may be, and in that case the tag will be associated with anull
value. -
equals
-
hashCode
public int hashCode() -
toString
-