tech.jhipster.lite.module.domain.landscape.JHipsterLandscapeLevel Maven / Gradle / Ivy
package tech.jhipster.lite.module.domain.landscape;
import java.util.Collection;
import java.util.Collections;
import java.util.stream.Stream;
import tech.jhipster.lite.module.domain.JHipsterSlug;
import tech.jhipster.lite.shared.error.domain.Assert;
public record JHipsterLandscapeLevel(Collection extends JHipsterLandscapeElement> elements) {
public JHipsterLandscapeLevel(Collection extends JHipsterLandscapeElement> elements) {
Assert.notEmpty("elements", elements);
this.elements = Collections.unmodifiableCollection(elements);
}
public Stream slugs() {
return elements.stream().flatMap(JHipsterLandscapeElement::slugs);
}
}