-
-
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.
Merge pull request #10297 from renanfranca/10239-manage-landscape-pre…
…set-configuration manage landscape preset configuration
- Loading branch information
Showing
11 changed files
with
196 additions
and
6 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
...te/project/domain/history/ModuleSlug.java → ...pster/lite/project/domain/ModuleSlug.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
14 changes: 14 additions & 0 deletions
14
src/main/java/tech/jhipster/lite/project/domain/ModulesSlugs.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.project.domain; | ||
|
||
import java.util.Collection; | ||
import tech.jhipster.lite.shared.error.domain.Assert; | ||
|
||
public record ModulesSlugs(Collection<ModuleSlug> modules) { | ||
public ModulesSlugs { | ||
Assert.notEmpty("modules", modules); | ||
} | ||
|
||
public static ModulesSlugs from(Collection<String> modules) { | ||
return new ModulesSlugs(modules.stream().map(ModuleSlug::new).toList()); | ||
} | ||
} |
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
11 changes: 11 additions & 0 deletions
11
src/main/java/tech/jhipster/lite/project/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package tech.jhipster.lite.project.domain.preset; | ||
|
||
import tech.jhipster.lite.project.domain.ModulesSlugs; | ||
import tech.jhipster.lite.shared.error.domain.Assert; | ||
|
||
public record Preset(PresetName name, ModulesSlugs modules) { | ||
public Preset { | ||
Assert.notNull("name", name); | ||
Assert.notNull("modules", modules); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/tech/jhipster/lite/project/domain/preset/PresetName.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,13 @@ | ||
package tech.jhipster.lite.project.domain.preset; | ||
|
||
import tech.jhipster.lite.shared.error.domain.Assert; | ||
|
||
public record PresetName(String name) { | ||
public PresetName { | ||
Assert.notBlank("name", name); | ||
} | ||
|
||
public static PresetName from(String name) { | ||
return new PresetName(name); | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
src/main/java/tech/jhipster/lite/project/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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package tech.jhipster.lite.project.infrastructure.secondary; | ||
|
||
import java.util.Collection; | ||
import tech.jhipster.lite.project.domain.ModulesSlugs; | ||
import tech.jhipster.lite.project.domain.preset.Preset; | ||
import tech.jhipster.lite.project.domain.preset.PresetName; | ||
|
||
record PersistedPreset(String name, Collection<String> modules) { | ||
public Preset toDomain() { | ||
return new Preset(PresetName.from(name), ModulesSlugs.from(modules)); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
src/main/java/tech/jhipster/lite/project/infrastructure/secondary/PersistedPresets.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,11 @@ | ||
package tech.jhipster.lite.project.infrastructure.secondary; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import java.util.Collection; | ||
import tech.jhipster.lite.project.domain.preset.Preset; | ||
|
||
record PersistedPresets(@JsonProperty("presets") Collection<PersistedPreset> presets) { | ||
public Collection<Preset> toDomain() { | ||
return presets.stream().map(PersistedPreset::toDomain).toList(); | ||
} | ||
} |
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