Class ToolchainModel

java.lang.Object
org.apache.maven.api.toolchain.TrackableBase
org.apache.maven.api.toolchain.ToolchainModel
All Implemented Interfaces:
Serializable, InputLocationTracker

Definition of a toolchain instance.
See Also:
  • Constructor Details

  • Method Details

    • getType

      public String getType()
      Type of toolchain:
      Returns:
      a String
    • getProvides

      @Nonnull public Map<String,String> getProvides()
      Toolchain identification information, which will be matched against project requirements.

      For Maven 2.0.9 to 3.2.3, the actual content structure was completely open: each toolchain type would define its own format and semantics. This was generally a properties format.

      Since Maven 3.2.4, the type for this field has been changed to Properties to match the de-facto format.

      Each toolchain defines its own properties names and semantics.

      Returns:
      a Map<String, String>
    • getConfiguration

      public XmlNode getConfiguration()
      Toolchain configuration information, like location or any information that is to be retrieved.

      Actual content structure is completely open: each toolchain type will define its own format and semantics.

      In general, this is a properties format: <name>value</name> with per-toolchain defined properties names.

      Returns:
      a XmlNode
    • with

      Creates a new builder with this object as the basis.
      Overrides:
      with in class TrackableBase
      Returns:
      a Builder
    • withType

      @Nonnull public ToolchainModel withType(String type)
      Creates a new ToolchainModel instance using the specified type.
      Parameters:
      type - the new String to use
      Returns:
      a ToolchainModel with the specified type
    • withProvides

      @Nonnull public ToolchainModel withProvides(Map<String,String> provides)
      Creates a new ToolchainModel instance using the specified provides.
      Parameters:
      provides - the new Map<String, String> to use
      Returns:
      a ToolchainModel with the specified provides
    • withConfiguration

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

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

      @Nonnull public static ToolchainModel newInstance(boolean withDefaults)
      Creates a new ToolchainModel 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 ToolchainModel
    • newBuilder

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

      @Nonnull public static ToolchainModel.Builder newBuilder(boolean withDefaults)
      Creates a new ToolchainModel 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 ToolchainModel.Builder newBuilder(ToolchainModel from)
      Creates a new ToolchainModel builder instance using the specified object as a basis. Equivalent to newBuilder(from, false).
      Parameters:
      from - the ToolchainModel instance to use as a basis
      Returns:
      a new Builder
    • newBuilder

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

      public int hashCode()
      Computes a hash value based on getType() and getProvides() values.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Checks equality based on getType() and getProvides() values.
      Overrides:
      equals in class Object