tech.jhipster.lite.module.infrastructure.primary.RestJHipsterLandscape Maven / Gradle / Ivy
package tech.jhipster.lite.module.infrastructure.primary;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.media.Schema.RequiredMode;
import java.util.Collection;
import tech.jhipster.lite.module.domain.landscape.JHipsterLandscape;
@Schema(name = "JHipsterLandscape", description = "Landscape of modules in JHipster")
final class RestJHipsterLandscape {
private final Collection levels;
private RestJHipsterLandscape(Collection levels) {
this.levels = levels;
}
static RestJHipsterLandscape from(JHipsterLandscape landscape) {
return new RestJHipsterLandscape(landscape.levels().stream().map(RestJHipsterLandscapeLevel::from).toList());
}
@Schema(description = "Levels in the landscape", requiredMode = RequiredMode.REQUIRED)
public Collection getLevels() {
return levels;
}
}