java.lang.Object
org.forgerock.monitoring.api.instrument.Tags
All Implemented Interfaces:
Iterable<Tag>

public final class Tags extends Object implements Iterable<Tag>
An immutable collection of Tags.
  • Method Details

    • and

      public Tags and(String key, String value)
      Return a new Tags instance my merging this collection and the specific key/value pair.
      Parameters:
      key - the tag key to add
      value - the tag value add
      Returns:
      a new Tags instance
    • and

      public Tags and(@Nullable String... keyValues)
      Return a new Tags instance my merging this collection and the specific key/value pairs.
      Parameters:
      keyValues - the key value pairs to add
      Returns:
      a new Tags instance
    • and

      public Tags and(@Nullable Tag... tags)
      Return a new Tags instance my merging this collection and the specific tags.
      Parameters:
      tags - the tags to add
      Returns:
      a new Tags instance
    • and

      public Tags and(@Nullable Iterable<? extends Tag> tags)
      Return a new Tags instance my merging this collection and the specific tags.
      Parameters:
      tags - the tags to add
      Returns:
      a new Tags instance
    • iterator

      public Iterator<Tag> iterator()
      Specified by:
      iterator in interface Iterable<Tag>
    • stream

      public Stream<Tag> stream()
      Return a stream of the contained tags.
      Returns:
      a tags stream
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • concat

      public static Tags concat(Iterable<? extends Tag> tags, Iterable<Tag> otherTags)
      Return a new Tags instance my concatenating the specified values.
      Parameters:
      tags - the first set of tags
      otherTags - the second set of tags
      Returns:
      the merged tags
    • concat

      public static Tags concat(Iterable<? extends Tag> tags, String... keyValues)
      Return a new Tags instance my concatenating the specified key value pairs.
      Parameters:
      tags - the first set of tags
      keyValues - the additional key value pairs to add
      Returns:
      the merged tags
    • of

      public static Tags of(Iterable<? extends Tag> tags)
      Return a new Tags instance containing tags constructed from the specified source tags.
      Parameters:
      tags - the tags to add
      Returns:
      a new Tags instance
    • of

      public static Tags of(String key, String value)
      Return a new Tags instance containing tags constructed from the specified name value pair.
      Parameters:
      key - the tag key to add
      value - the tag value to add
      Returns:
      a new Tags instance
    • of

      public static Tags of(String... keyValues)
      Return a new Tags instance containing tags constructed from the specified key value pairs.
      Parameters:
      keyValues - the key value pairs to add
      Returns:
      a new Tags instance
    • of

      public static Tags of(Tag... tags)
      Return a new Tags instance containing tags constructed from the specified tags.
      Parameters:
      tags - the tags to add
      Returns:
      a new Tags instance
    • empty

      public static Tags empty()
      Return a Tags instance that contains no elements.
      Returns:
      an empty Tags instance