C - Type of content that can be sent on this topic.public class SimpleTopic<C> extends Object implements Topic<C>
Note that two instances having the same contents will not be considered equal.
| Constructor and Description |
|---|
SimpleTopic()
Constructor.
|
SimpleTopic(String name)
Constructor.
|
SimpleTopic(String name,
Topic<? super C> parent)
Constructor.
|
SimpleTopic(Topic<? super C> parent)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getName()
Gets the name of the topic (or topic instance), mostly useful for logging/debugging purposes.
|
Topic<? super C> |
getParentTopic()
Gets the parent topic if any.
|
String |
toString() |
public SimpleTopic()
A unique name will be chosen.
public SimpleTopic(String name)
The specified name should either be unique or null. If it is null, a unique name will be chosen (different for each instance).
name - Unique name or null.public SimpleTopic(Topic<? super C> parent)
parent - Parent topic covering this topic, or null.public SimpleTopic(String name, Topic<? super C> parent)
The specified name should either be unique or null. If it is null, a unique name will be chosen (different for each instance).
name - Unique name or null.parent - Parent topic covering this topic, or null.public String getName()
TopicBy default, the class's simple name followed by the instance's hash code.
getName in interface Topic<C>Topic.getName()public Topic<? super C> getParentTopic()
TopicA topic knows its parent, but a parent topic may or may not know their child topics depending on the implementation.
getParentTopic in interface Topic<C>Topic.getParentTopic()Copyright © 2017. All rights reserved.