build method

IPattern<T> build()

Builds a composite pattern from this builder. Further changes to this builder will have no impact on the returned pattern.

Returns: A pattern using the patterns added to this builder.

  • StateError: No component patterns have been added.

Implementation

IPattern<T> build() {
  Preconditions.checkState(_patterns.isNotEmpty, 'A composite pattern must have at least one component pattern.');
  return _CompositePattern<T>._(_patterns, _formatPredicates);
}