public class

TagSelector

extends Object
implements JsonSerializable
java.lang.Object
   ↳ com.urbanairship.iam.TagSelector

Class Overview

Tag selector.

Summary

Fields
public static final Map<StringSet<String>> EMPTY_TAG_GROUPS
Public Methods
static TagSelector and(TagSelector... selectors)
Creates an AND tag selector.
static TagSelector and(List<TagSelector> selectors)
Creates an AND tag selector.
boolean apply(Collection<String> tags)
Applies the tag selector to a collection of tags.
boolean equals(Object o)
Map<StringSet<String>> getTagGroups()
Gets any tag groups defined by the selector.
int hashCode()
static TagSelector not(TagSelector selector)
Creates an NOT tag selector.
static TagSelector or(TagSelector... selectors)
Creates an OR tag selector.
static TagSelector or(List<TagSelector> selectors)
Creates an OR tag selector.
static TagSelector parseJson(JsonValue jsonValue)
Parses a json value for a tag selector.
static TagSelector tag(String tag)
Creates a tag selector that checks for tag.
static TagSelector tag(String tag, String group)
Creates a tag selector that checks for tag in a group.
JsonValue toJsonValue()
Returns the objects represented as a JsonValue.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.urbanairship.json.JsonSerializable

Fields

public static final Map<StringSet<String>> EMPTY_TAG_GROUPS

Public Methods

public static TagSelector and (TagSelector... selectors)

Creates an AND tag selector.

Parameters
selectors The selectors to AND together.
Returns
  • The AND tag selector.

public static TagSelector and (List<TagSelector> selectors)

Creates an AND tag selector.

Parameters
selectors The selectors to AND together.
Returns
  • The AND tag selector.

public boolean apply (Collection<String> tags)

Applies the tag selector to a collection of tags.

Parameters
tags The collection of tags.
Returns
  • true if the tag selector matches the tags, otherwise false.

public boolean equals (Object o)

public Map<StringSet<String>> getTagGroups ()

Gets any tag groups defined by the selector.

Returns
  • The selector's tag groups.

public int hashCode ()

public static TagSelector not (TagSelector selector)

Creates an NOT tag selector.

Parameters
selector The selectors to negate.
Returns
  • The NOT tag selector.

public static TagSelector or (TagSelector... selectors)

Creates an OR tag selector.

Parameters
selectors The selectors to OR together.
Returns
  • The OR tag selector.

public static TagSelector or (List<TagSelector> selectors)

Creates an OR tag selector.

Parameters
selectors The selectors to OR together.
Returns
  • The OR tag selector.

public static TagSelector parseJson (JsonValue jsonValue)

Parses a json value for a tag selector.

Parameters
jsonValue The json value.
Returns
  • The parsed tag selector.
Throws
JsonException If the json value does not contain a valid tag selector.

public static TagSelector tag (String tag)

Creates a tag selector that checks for tag.

Parameters
tag The tag.
Returns
  • A tag selector.

public static TagSelector tag (String tag, String group)

Creates a tag selector that checks for tag in a group.

Parameters
tag The tag.
group The group.
Returns
  • A tag selector.

public JsonValue toJsonValue ()

Returns the objects represented as a JsonValue.

Returns
  • The object as a JsonValue.

public String toString ()