com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto
Enum GerritEventType

java.lang.Object
  extended by java.lang.Enum<GerritEventType>
      extended by com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.GerritEventType
All Implemented Interfaces:
Serializable, Comparable<GerritEventType>

public enum GerritEventType
extends Enum<GerritEventType>

Representation of the type of event, if they are interesting and what class to use to parse the JSON string.

Author:
Robert Sandell <robert.sandell@sonyericsson.com>

Enum Constant Summary
CHANGE_ABANDONED
          A change-abandoned event.
CHANGE_MERGED
          A change-merged event.
COMMENT_ADDED
          A comment-added event.
DRAFT_PUBLISHED
          A draft-published event.
PATCHSET_CREATED
          A patchset-created event.
REF_UPDATED
          A ref-updated event.
 
Method Summary
static GerritEventType findByTypeValue(String typeValue)
          Finds the event type for the specified type-value.
 Class<? extends GerritJsonEvent> getEventRepresentative()
          Gets the DTO class that represents this kind of event.
static GerritEventType[] getInterestingEventTypes()
          Lists all event types that are interesting.
 String getTypeValue()
          The value of the type property in the JSON object.
 boolean isInteresting()
          If this event type is interesting from a functionality perspective.
static GerritEventType valueOf(String name)
          Returns the enum constant of this type with the specified name.
static GerritEventType[] 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

PATCHSET_CREATED

public static final GerritEventType PATCHSET_CREATED
A patchset-created event.


DRAFT_PUBLISHED

public static final GerritEventType DRAFT_PUBLISHED
A draft-published event.


CHANGE_ABANDONED

public static final GerritEventType CHANGE_ABANDONED
A change-abandoned event.


CHANGE_MERGED

public static final GerritEventType CHANGE_MERGED
A change-merged event.


COMMENT_ADDED

public static final GerritEventType COMMENT_ADDED
A comment-added event.


REF_UPDATED

public static final GerritEventType REF_UPDATED
A ref-updated event.

Method Detail

values

public static GerritEventType[] 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 (GerritEventType c : GerritEventType.values())
    System.out.println(c);

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

valueOf

public static GerritEventType valueOf(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:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getTypeValue

public String getTypeValue()
The value of the type property in the JSON object.

Returns:
the type-value.

isInteresting

public boolean isInteresting()
If this event type is interesting from a functionality perspective.

Returns:
true if it is interesting.

getEventRepresentative

public Class<? extends GerritJsonEvent> getEventRepresentative()
Gets the DTO class that represents this kind of event.

Returns:
the class object.

findByTypeValue

public static GerritEventType findByTypeValue(String typeValue)
Finds the event type for the specified type-value.

Parameters:
typeValue - the value of the JSON object's type property.
Returns:
the event type or null if nothing was found.

getInterestingEventTypes

public static GerritEventType[] getInterestingEventTypes()
Lists all event types that are interesting.

Returns:
The interesting event-types.
See Also:
isInteresting()


Copyright © 2004-2012 Hudson. All Rights Reserved.