Class Notifier

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

Configures one method for notifying users/developers when a build breaks.
See Also:
  • Method Details

    • getType

      public String getType()
      The mechanism used to deliver notifications.
      Returns:
      a String
    • isSendOnError

      public boolean isSendOnError()
      Whether to send notifications on error.
      Returns:
      a boolean
    • isSendOnFailure

      public boolean isSendOnFailure()
      Whether to send notifications on failure.
      Returns:
      a boolean
    • isSendOnSuccess

      public boolean isSendOnSuccess()
      Whether to send notifications on success.
      Returns:
      a boolean
    • isSendOnWarning

      public boolean isSendOnWarning()
      Whether to send notifications on warning.
      Returns:
      a boolean
    • getAddress

      public String getAddress()
      Deprecated. Where to send the notification to - eg email address.
      Returns:
      a String
    • getConfiguration

      @Nonnull public Map<String,String> getConfiguration()
      Extended configuration specific to this notifier goes here.
      Returns:
      a Map<String, String>
    • getLocation

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

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

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

      @Nonnull public Notifier withSendOnError(boolean sendOnError)
      Creates a new Notifier instance using the specified sendOnError.
      Parameters:
      sendOnError - the new boolean to use
      Returns:
      a Notifier with the specified sendOnError
    • withSendOnFailure

      @Nonnull public Notifier withSendOnFailure(boolean sendOnFailure)
      Creates a new Notifier instance using the specified sendOnFailure.
      Parameters:
      sendOnFailure - the new boolean to use
      Returns:
      a Notifier with the specified sendOnFailure
    • withSendOnSuccess

      @Nonnull public Notifier withSendOnSuccess(boolean sendOnSuccess)
      Creates a new Notifier instance using the specified sendOnSuccess.
      Parameters:
      sendOnSuccess - the new boolean to use
      Returns:
      a Notifier with the specified sendOnSuccess
    • withSendOnWarning

      @Nonnull public Notifier withSendOnWarning(boolean sendOnWarning)
      Creates a new Notifier instance using the specified sendOnWarning.
      Parameters:
      sendOnWarning - the new boolean to use
      Returns:
      a Notifier with the specified sendOnWarning
    • withAddress

      @Nonnull public Notifier withAddress(String address)
      Creates a new Notifier instance using the specified address.
      Parameters:
      address - the new String to use
      Returns:
      a Notifier with the specified address
    • withConfiguration

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

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

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

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

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

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