hudson.plugins.jabber
Enum NotificationStrategy

java.lang.Object
  extended by java.lang.Enum<NotificationStrategy>
      extended by hudson.plugins.jabber.NotificationStrategy
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<NotificationStrategy>

public enum NotificationStrategy
extends java.lang.Enum<NotificationStrategy>

Represents the notification strategy.

Author:
Uwe Schaefer

Enum Constant Summary
ALL
          Not matter what, notifications sould always be sent.
ANY_FAILURE
          Whenever there is a failure, a Notification should be sent.
STATECHANGE_ONLY
          Notifications should be sent only if there was a change in the build state, or this was the first build.
 
Method Summary
abstract  boolean notificationWanted(hudson.model.Build build)
          Signals if the given build qualifies to send a notification according to the current strategy.
static NotificationStrategy valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static NotificationStrategy[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

STATECHANGE_ONLY

public static final NotificationStrategy STATECHANGE_ONLY
Notifications should be sent only if there was a change in the build state, or this was the first build.


ALL

public static final NotificationStrategy ALL
Not matter what, notifications sould always be sent.


ANY_FAILURE

public static final NotificationStrategy ANY_FAILURE
Whenever there is a failure, a Notification should be sent.

Method Detail

values

public static NotificationStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (NotificationStrategy c : NotificationStrategy.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static NotificationStrategy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

notificationWanted

public abstract boolean notificationWanted(hudson.model.Build build)
Signals if the given build qualifies to send a notification according to the current strategy.

Parameters:
build - The build for which it should be decided, if notification is wanted or not.
Returns:
true if, according to the given strategy, a notification should be sent.


Copyright © 2007. All Rights Reserved.