Interface Attribute

All Superinterfaces:
Serializable

public interface Attribute extends Serializable
Represents metadata from build systems external to OpenRewrite. Stored in a map of strings to strings for simplicity of
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static @Nullable Optional<Attribute>
    from(@Nullable String value)
    Subclasses are expected to have a from() method which translates a string into that subtype of attribute, or null
    static String
    key()
    Subclasses are expected to have a key method with this signature.
  • Method Details

    • key

      static String key()
      Subclasses are expected to have a key method with this signature. Used to know which entries in a map correspond to elements of the type of the attribute. When the attribute's origin is an external system, such as Gradle's HasAttributes class, the key returned by this should be the same key used in the foreign attribute system.
    • from

      static @Nullable Optional<Attribute> from(@Nullable String value)
      Subclasses are expected to have a from() method which translates a string into that subtype of attribute, or null