All Downloads are FREE. Search and download functionalities are using the official Maven repository.

tech.jhipster.lite.module.infrastructure.primary.RestJHipsterLandscapeElement Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
package tech.jhipster.lite.module.infrastructure.primary;

import io.swagger.v3.oas.annotations.media.Schema;
import tech.jhipster.lite.module.domain.landscape.JHipsterLandscapeElement;
import tech.jhipster.lite.module.domain.landscape.JHipsterLandscapeElementType;
import tech.jhipster.lite.module.domain.landscape.JHipsterLandscapeFeature;
import tech.jhipster.lite.module.domain.landscape.JHipsterLandscapeModule;

@Schema(name = "JHipsterLandscapeElement", description = "An element in a landscape, can be either a module or a feature")
sealed interface RestJHipsterLandscapeElement permits RestJHipsterLandscapeModule, RestJHipsterLandscapeFeature {
  JHipsterLandscapeElementType getType();

  static RestJHipsterLandscapeElement from(JHipsterLandscapeElement element) {
    return switch (element) {
      case JHipsterLandscapeModule module -> RestJHipsterLandscapeModule.fromModule(module);
      case JHipsterLandscapeFeature feature -> RestJHipsterLandscapeFeature.fromFeature(feature);
    };
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy