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

tech.jhipster.lite.module.domain.landscape.JHipsterLandscapeDependencies Maven / Gradle / Ivy

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

import static java.util.function.Predicate.*;

import java.util.Collection;
import java.util.Optional;
import java.util.stream.Stream;
import tech.jhipster.lite.shared.error.domain.Assert;

public record JHipsterLandscapeDependencies(Collection dependencies) {
  public JHipsterLandscapeDependencies {
    Assert.notEmpty("dependencies", dependencies);
  }

  public static Optional of(Collection dependencies) {
    return Optional.ofNullable(dependencies).filter(not(Collection::isEmpty)).map(JHipsterLandscapeDependencies::new);
  }

  public long count() {
    return dependencies().size();
  }

  public Stream stream() {
    return dependencies().stream().map(JHipsterLandscapeDependency.class::cast);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy