-
-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(preset): delete ModulesSlugs.java from the "project" bounded…
… context and use JHipsterModuleSlugs.java from the "module" bounded context instead
- Loading branch information
1 parent
fbddcdc
commit 789394b
Showing
7 changed files
with
38 additions
and
38 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
src/main/java/tech/jhipster/lite/module/domain/JHipsterModuleSlugs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package tech.jhipster.lite.module.domain; | ||
|
||
import java.util.Collection; | ||
import tech.jhipster.lite.shared.error.domain.Assert; | ||
|
||
public record JHipsterModuleSlugs(Collection<JHipsterModuleSlug> modules) { | ||
public JHipsterModuleSlugs { | ||
Assert.notEmpty("modules", modules); | ||
} | ||
|
||
public static JHipsterModuleSlugs from(Collection<String> modules) { | ||
return new JHipsterModuleSlugs(modules.stream().map(JHipsterModuleSlug::new).toList()); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
src/main/java/tech/jhipster/lite/module/domain/preset/Preset.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/tech/jhipster/lite/module/infrastructure/primary/RestModuleToApply.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
package tech.jhipster.lite.module.infrastructure.primary; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import tech.jhipster.lite.project.domain.ModuleSlug; | ||
import tech.jhipster.lite.module.domain.JHipsterModuleSlug; | ||
|
||
@Schema(name = "ModuleToApply", description = "Information for a module to apply") | ||
record RestModuleToApply(@Schema(description = "Slug of the module to apply") String slug) { | ||
public static RestModuleToApply from(ModuleSlug moduleSlug) { | ||
public static RestModuleToApply from(JHipsterModuleSlug moduleSlug) { | ||
return new RestModuleToApply(moduleSlug.get()); | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
src/main/java/tech/jhipster/lite/module/infrastructure/secondary/PersistedPreset.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
package tech.jhipster.lite.module.infrastructure.secondary; | ||
|
||
import java.util.Collection; | ||
import tech.jhipster.lite.module.domain.JHipsterModuleSlugs; | ||
import tech.jhipster.lite.module.domain.preset.Preset; | ||
import tech.jhipster.lite.module.domain.preset.PresetName; | ||
import tech.jhipster.lite.project.domain.ModulesSlugs; | ||
|
||
record PersistedPreset(String name, Collection<String> modules) { | ||
public Preset toDomain() { | ||
return new Preset(PresetName.from(name), ModulesSlugs.from(modules)); | ||
return new Preset(PresetName.from(name), JHipsterModuleSlugs.from(modules)); | ||
} | ||
} |
14 changes: 0 additions & 14 deletions
14
src/main/java/tech/jhipster/lite/project/domain/ModulesSlugs.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters