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

tech.jhipster.lite.module.infrastructure.secondary.javadependency.maven.MavenScope Maven / Gradle / Ivy

There is a newer version: 1.22.0
Show newest version
package tech.jhipster.lite.module.infrastructure.secondary.javadependency.maven;

import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;

enum MavenScope {
  COMPILE,
  IMPORT,
  PROVIDED,
  SYSTEM,
  RUNTIME,
  TEST;

  private static final Map SCOPES = buildScopes();

  private static Map buildScopes() {
    return Stream.of(values()).collect(Collectors.toUnmodifiableMap(scope -> scope.name().toLowerCase(), Function.identity()));
  }

  static MavenScope from(String scope) {
    if (scope == null) {
      return null;
    }

    return SCOPES.get(scope.toLowerCase());
  }

  String key() {
    return name().toLowerCase();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy