io.legaldocml.business.builder.CollectionBodyBuilder Maven / Gradle / Ivy
The newest version!
package io.legaldocml.business.builder;
import io.legaldocml.akn.element.CollectionBody;
import io.legaldocml.akn.element.Component;
import io.legaldocml.business.builder.element.DocContainerTypeBuilder;
import java.util.function.Consumer;
/**
* @author Jacques Militello
*/
public final class CollectionBodyBuilder extends AbstractBusinessPartBuilder {
CollectionBodyBuilder(BusinessBuilder businessBuilder, CollectionBody body) {
super(businessBuilder, body);
}
public DocContainerTypeBuilder component() {
return component(null);
}
public DocContainerTypeBuilder component(Consumer consumer) {
Component component = new Component();
parent().add(component);
if (consumer != null) {
consumer.accept(component);
}
return new DocContainerTypeBuilder<>(businessBuilder(),component);
}
}