Enum Class Usage

java.lang.Object
java.lang.Enum<Usage>
org.openrewrite.gradle.attributes.Usage
All Implemented Interfaces:
Serializable, Comparable<Usage>, Constable, org.openrewrite.maven.attributes.Attribute

public enum Usage extends Enum<Usage> implements org.openrewrite.maven.attributes.Attribute
Attribute representing the usage of a dependency variant. This describes the intended consumer use case for a variant (e.g., compiling against an API, runtime execution). See usage javadoc
  • Enum Constant Details

    • JAVA_API

      public static final Usage JAVA_API
      The Java API of a library, packaged as class path elements, either a JAR or a classes directory.
    • JAVA_RUNTIME

      public static final Usage JAVA_RUNTIME
      The Java runtime of a component, packaged as class path elements, either a JAR or a classes directory.
    • C_PLUS_PLUS_API

      public static final Usage C_PLUS_PLUS_API
      The C++ API of a library, packaged as header directories.
    • NATIVE_RUNTIME

      public static final Usage NATIVE_RUNTIME
      The native runtime files of a library, packaged as a shared library.
    • SWIFT_API

      public static final Usage SWIFT_API
      The Swift API of a library, packaged as swiftmodule files.
    • VERSION_CATALOG

      public static final Usage VERSION_CATALOG
      A version catalog, packaged as TOML files, for use as recommendations for dependency and plugin versions.
  • Method Details

    • values

      public static Usage[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Usage valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • key

      public static String key()
    • from

      public static @Nullable Usage from(@Nullable String usage)