public class TopicSet extends LinkedHashSet<String>
TopicSelector
strings.
The set order is maintained in the order that Topic names/selectors are added to the set.
Note that names or selectors are not validated as they are added to the set
but may be validated using validate(boolean)
.
Whether selectors are allowed within the set depends upon what the set is to be used for.
Constructor and Description |
---|
TopicSet()
Constructs an empty topic set.
|
TopicSet(Collection<String> topicStrings)
Constructs a Topic set from a collection of Topic names and/or
TopicSelector strings. |
TopicSet(String... topicStrings)
Constructs a Topic set from any number of
TopicSelector strings. |
Modifier and Type | Method and Description |
---|---|
String |
toString()
Returns a delimited list of the Topic names or
TopicSelector
strings. |
void |
validate(boolean allowSelectors)
Validates all of the entries in the Topic set.
|
add, clear, clone, contains, isEmpty, iterator, remove, size
equals, hashCode, removeAll
addAll, containsAll, retainAll, toArray, toArray
public TopicSet()
public TopicSet(String... topicStrings)
TopicSelector
strings.
A selector string can contain a Topic name or selector or a comma delimited list of Topic names and/or selectors.
If no Topic strings are supplied then an empty Topic set is created.
topicStrings
- an array of Topic specifier strings.public TopicSet(Collection<String> topicStrings)
TopicSelector
strings.
topicStrings
- collection of selector strings. If this is null or
empty then an empty Topic set is created.public void validate(boolean allowSelectors) throws TopicInvalidException
allowSelectors
- if true then TopicSelector
s will be allowed
within the set otherwise all entries must be valid Topic names.TopicInvalidException
- if an invalid entry is found.public String toString()
TopicSelector
strings.
toString
in class AbstractCollection<String>
Copyright © 2016 Push Technology Ltd. All Rights Reserved.