Class Extension

java.lang.Object
org.apache.maven.api.model.Extension
All Implemented Interfaces:
Serializable, InputLocationTracker

Describes a build extension to utilise.
See Also:
  • Constructor Details

  • Method Details

    • getGroupId

      public String getGroupId()
      The group ID of the extension's artifact.
      Returns:
      a String
    • getArtifactId

      public String getArtifactId()
      The artifact ID of the extension.
      Returns:
      a String
    • getVersion

      public String getVersion()
      The version of the extension.
      Returns:
      a String
    • getConfiguration

      public XmlNode getConfiguration()
      The configuration of the extension.
      Returns:
      a XmlNode
      Since:
      Maven 4.0.0
    • getLocation

      public InputLocation getLocation(Object key)
      Gets the location of the specified field in the input source.
      Specified by:
      getLocation in interface InputLocationTracker
    • getLocationKeys

      public Set<Object> getLocationKeys()
      Gets the keys of the locations of the input source.
    • getLocationKeyStream

      protected Stream<Object> getLocationKeyStream()
    • getImportedFrom

      public InputLocation getImportedFrom()
      Gets the input location that caused this model to be read.
      Specified by:
      getImportedFrom in interface InputLocationTracker
      Returns:
      InputLocation
    • with

      @Nonnull public Extension.Builder with()
      Creates a new builder with this object as the basis.
      Returns:
      a Builder
    • withGroupId

      @Nonnull public Extension withGroupId(String groupId)
      Creates a new Extension instance using the specified groupId.
      Parameters:
      groupId - the new String to use
      Returns:
      a Extension with the specified groupId
    • withArtifactId

      @Nonnull public Extension withArtifactId(String artifactId)
      Creates a new Extension instance using the specified artifactId.
      Parameters:
      artifactId - the new String to use
      Returns:
      a Extension with the specified artifactId
    • withVersion

      @Nonnull public Extension withVersion(String version)
      Creates a new Extension instance using the specified version.
      Parameters:
      version - the new String to use
      Returns:
      a Extension with the specified version
    • withConfiguration

      @Nonnull public Extension withConfiguration(XmlNode configuration)
      Creates a new Extension instance using the specified configuration.
      Parameters:
      configuration - the new XmlNode to use
      Returns:
      a Extension with the specified configuration
    • newInstance

      @Nonnull public static Extension newInstance()
      Creates a new Extension instance. Equivalent to newInstance(true).
      Returns:
      a new Extension
      See Also:
    • newInstance

      @Nonnull public static Extension newInstance(boolean withDefaults)
      Creates a new Extension instance using default values or not. Equivalent to newBuilder(withDefaults).build().
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Extension
    • newBuilder

      @Nonnull public static Extension.Builder newBuilder()
      Creates a new Extension builder instance. Equivalent to newBuilder(true).
      Returns:
      a new Builder
      See Also:
    • newBuilder

      @Nonnull public static Extension.Builder newBuilder(boolean withDefaults)
      Creates a new Extension builder instance using default values or not.
      Parameters:
      withDefaults - the boolean indicating whether default values should be used
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Extension.Builder newBuilder(Extension from)
      Creates a new Extension builder instance using the specified object as a basis. Equivalent to newBuilder(from, false).
      Parameters:
      from - the Extension instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

      @Nonnull public static Extension.Builder newBuilder(Extension from, boolean forceCopy)
      Creates a new Extension builder instance using the specified object as a basis.
      Parameters:
      from - the Extension instance to use as a basis
      forceCopy - the boolean indicating if a copy should be forced
      Returns:
      a new Builder
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
      See Also: