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

tech.jhipster.lite.module.domain.javadependency.JavaDependencyScope Maven / Gradle / Ivy

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

import tech.jhipster.lite.shared.error.domain.Assert;

public enum JavaDependencyScope {
  COMPILE(6),
  IMPORT(5),
  PROVIDED(4),
  SYSTEM(3),
  RUNTIME(2),
  TEST(1);

  private final int priority;

  JavaDependencyScope(int priority) {
    this.priority = priority;
  }

  static JavaDependencyScope from(JavaDependencyScope scope) {
    if (scope == null) {
      return COMPILE;
    }

    return scope;
  }

  JavaDependencyScope merge(JavaDependencyScope other) {
    Assert.notNull("other", other);

    if (other.priority > priority) {
      return other;
    }

    return this;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy