com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events
Class ChangeBasedEvent

java.lang.Object
  extended by com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.lifecycle.GerritEventLifecycle
      extended by com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.GerritTriggeredEvent
          extended by com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.ChangeBasedEvent
All Implemented Interfaces:
GerritEvent
Direct Known Subclasses:
ChangeAbandoned, ChangeMerged, CommentAdded, DraftPublished, PatchsetCreated

public abstract class ChangeBasedEvent
extends GerritTriggeredEvent

Base class for all GeritTriggeredEvents containing a Change.

Author:
Tomas Westling <tomas.westling@sonymobile.com>

Field Summary
protected  Change change
          The Gerrit change the event is related to.
protected  PatchSet patchSet
          Refers to a specific patchset within a change.
 
Fields inherited from class com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.GerritTriggeredEvent
account
 
Constructor Summary
ChangeBasedEvent()
           
 
Method Summary
 boolean equals(Object o)
           
 void fromJson(net.sf.json.JSONObject json)
          Takes a JSON object and fills its internal data-structure.
 Change getChange()
          The Change.
 List<String> getFiles(GerritQueryHandler gerritQueryHandler)
          Queries gerrit for the files included in this patch set.
 PatchSet getPatchSet()
          The patchSet.
 int hashCode()
           
 void setChange(Change change)
          The Change.
 void setPatchset(PatchSet patchset)
          The patchSet.
 
Methods inherited from class com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.GerritTriggeredEvent
getAccount, setAccount
 
Methods inherited from class com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.events.lifecycle.GerritEventLifecycle
addListener, fireAllBuildsCompleted, fireBuildCompleted, fireBuildStarted, fireProjectTriggered, fireTriggerScanDone, fireTriggerScanStarting, getListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.GerritEvent
getEventType, isScorable
 

Field Detail

change

protected Change change
The Gerrit change the event is related to.


patchSet

protected PatchSet patchSet
Refers to a specific patchset within a change.

Constructor Detail

ChangeBasedEvent

public ChangeBasedEvent()
Method Detail

getChange

public Change getChange()
The Change.

Returns:
the change.

setChange

public void setChange(Change change)
The Change.

Parameters:
change - the change.

getFiles

public List<String> getFiles(GerritQueryHandler gerritQueryHandler)
Queries gerrit for the files included in this patch set.

Parameters:
gerritQueryHandler - the query handler, responsible for the queries to gerrit.
Returns:
a list of files that are part of this patch set.

getPatchSet

public PatchSet getPatchSet()
The patchSet.

Returns:
The patchSet.

setPatchset

public void setPatchset(PatchSet patchset)
The patchSet.

Parameters:
patchset - the patchSet.

fromJson

public void fromJson(net.sf.json.JSONObject json)
Takes a JSON object and fills its internal data-structure.

Parameters:
json - the JSON Object.

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object


Copyright © 2004-2012 Hudson. All Rights Reserved.