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

tech.jhipster.lite.module.domain.resource.JHipsterHiddenModules Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
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 class JHipsterHiddenModules {

  private final Collection slugs;
  private final Collection tags;

  public JHipsterHiddenModules(Collection slugs, Collection tags) {
    this.slugs = JHipsterCollections.immutable(slugs);
    this.tags = buildTags(tags);
  }

  private List buildTags(Collection tags) {
    return JHipsterCollections.immutable(tags).stream().map(JHipsterModuleTag::new).toList();
  }

  public Collection slugs() {
    return slugs;
  }

  public Collection 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();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy