pbs-middleware-server/src/main/java/com/pbs/middleware/server/features/template/storage/TemplateFactory.java
/**
     * Loads a template for given id and applies all stored events on it.
     */
Loads a template for given id and applies all stored events on it.
Loads a template for given id and applies all stored events on it .
public Optional<Template> find(String id) {
        List<TemplateEvent> events = repository.findAllByDomainId(id);
        if (events.isEmpty()) {
            return empty();
        }
        Template template = new Template(id, publisher);
        events.forEach(template::apply);
        return of(template);
    }
public Optional < Template > find ( String id ) { List < TemplateEvent > events = repository . findAllByDomainId ( id ) ; if ( events . isEmpty ( ) ) { return empty ( ) ; } Template template = new Template ( id , publisher ) ; events . forEach ( template :: apply ) ; return of ( template ) ; }
Loads a template for given id and applies all stored events on it.
Loads a template for given id and applies all stored events on it .