Class Activation

java.lang.Object
org.apache.maven.api.settings.Activation
All Implemented Interfaces:
Serializable, InputLocationTracker

The conditions within the build runtime environment which will trigger the automatic inclusion of the parent build profile.
See Also:
  • Constructor Details

  • Method Details

    • isActiveByDefault

      public boolean isActiveByDefault()
      Flag specifying whether this profile is active as a default.
      Returns:
      a boolean
    • getJdk

      public String getJdk()
      Specifies that this profile will be activated when a matching JDK is detected.
      Returns:
      a String
    • getOs

      public ActivationOS getOs()
      Specifies that this profile will be activated when matching OS attributes are detected.
      Returns:
      a ActivationOS
    • getProperty

      public ActivationProperty getProperty()
      Specifies that this profile will be activated when this property is specified.
      Returns:
      a ActivationProperty
    • getFile

      public ActivationFile getFile()
      Specifies that this profile will be activated based on existence of a file.
      Returns:
      a ActivationFile
    • getPackaging

      public String getPackaging()
      Specifies that this profile will be activated based on the project's packaging.
      Returns:
      a String
    • getCondition

      public String getCondition()
      The condition which must be satisfied to activate the profile.
      Returns:
      a String
    • 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.
    • with

      Creates a new builder with this object as the basis.
      Returns:
      a Builder
    • withActiveByDefault

      @Nonnull public Activation withActiveByDefault(boolean activeByDefault)
      Creates a new Activation instance using the specified activeByDefault.
      Parameters:
      activeByDefault - the new boolean to use
      Returns:
      a Activation with the specified activeByDefault
    • withJdk

      @Nonnull public Activation withJdk(String jdk)
      Creates a new Activation instance using the specified jdk.
      Parameters:
      jdk - the new String to use
      Returns:
      a Activation with the specified jdk
    • withOs

      @Nonnull public Activation withOs(ActivationOS os)
      Creates a new Activation instance using the specified os.
      Parameters:
      os - the new ActivationOS to use
      Returns:
      a Activation with the specified os
    • withProperty

      @Nonnull public Activation withProperty(ActivationProperty property)
      Creates a new Activation instance using the specified property.
      Parameters:
      property - the new ActivationProperty to use
      Returns:
      a Activation with the specified property
    • withFile

      @Nonnull public Activation withFile(ActivationFile file)
      Creates a new Activation instance using the specified file.
      Parameters:
      file - the new ActivationFile to use
      Returns:
      a Activation with the specified file
    • withPackaging

      @Nonnull public Activation withPackaging(String packaging)
      Creates a new Activation instance using the specified packaging.
      Parameters:
      packaging - the new String to use
      Returns:
      a Activation with the specified packaging
    • withCondition

      @Nonnull public Activation withCondition(String condition)
      Creates a new Activation instance using the specified condition.
      Parameters:
      condition - the new String to use
      Returns:
      a Activation with the specified condition
    • newInstance

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

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

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

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

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