Topic constructor

Topic(
  1. String rawTopic,
  2. List validations
)

Creates a new instance of a rawTopic from a rawTopic string. rawTopic - The topic to represent. validations - The validations to run on the rawTopic.

Implementation

Topic(this.rawTopic, List<dynamic> validations) {
  topicFragments = rawTopic.split(topicSeparator[0]);
  // run all validations
  for (final dynamic validation in validations) {
    validation(this);
  }
}