-
-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rework JHipsterHiddenResourcesProperties
- Loading branch information
Showing
2 changed files
with
47 additions
and
11 deletions.
There are no files selected for viewing
47 changes: 44 additions & 3 deletions
47
src/main/java/tech/jhipster/lite/module/domain/resource/JHipsterHiddenModules.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,52 @@ | ||
package tech.jhipster.lite.module.domain.resource; | ||
|
||
import java.util.Collection; | ||
import java.util.List; | ||
import org.apache.commons.lang3.builder.EqualsBuilder; | ||
import org.apache.commons.lang3.builder.HashCodeBuilder; | ||
import tech.jhipster.lite.shared.collection.domain.JHipsterCollections; | ||
import tech.jhipster.lite.shared.generation.domain.ExcludeFromGeneratedCodeCoverage; | ||
|
||
public record JHipsterHiddenModules(Collection<String> slugs, Collection<JHipsterModuleTag> tags) { | ||
public JHipsterHiddenModules(Collection<String> slugs, Collection<JHipsterModuleTag> tags) { | ||
public class JHipsterHiddenModules { | ||
|
||
private final Collection<String> slugs; | ||
private final Collection<JHipsterModuleTag> tags; | ||
|
||
public JHipsterHiddenModules(Collection<String> slugs, Collection<String> tags) { | ||
this.slugs = JHipsterCollections.immutable(slugs); | ||
this.tags = JHipsterCollections.immutable(tags); | ||
this.tags = buildTags(tags); | ||
} | ||
|
||
private List<JHipsterModuleTag> buildTags(Collection<String> tags) { | ||
return JHipsterCollections.immutable(tags).stream().map(JHipsterModuleTag::new).toList(); | ||
} | ||
|
||
public Collection<String> slugs() { | ||
return slugs; | ||
} | ||
|
||
public Collection<JHipsterModuleTag> tags() { | ||
return tags; | ||
} | ||
|
||
@Override | ||
@ExcludeFromGeneratedCodeCoverage | ||
public int hashCode() { | ||
return new HashCodeBuilder().append(slugs).append(tags).hashCode(); | ||
} | ||
|
||
@Override | ||
@ExcludeFromGeneratedCodeCoverage | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
|
||
if (obj == null || getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
|
||
JHipsterHiddenModules other = (JHipsterHiddenModules) obj; | ||
return new EqualsBuilder().append(slugs, other.slugs).append(tags, other.tags).isEquals(); | ||
} | ||
} |
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