com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.attr
Class PatchSet

java.lang.Object
  extended by com.sonyericsson.hudson.plugins.gerrit.gerritevents.dto.attr.PatchSet
All Implemented Interfaces:
GerritJsonDTO

public class PatchSet
extends Object
implements GerritJsonDTO

Represents a Gerrit JSON Patchset DTO. Refers to a specific patchset within a change.

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

Constructor Summary
PatchSet()
          Default constructor.
PatchSet(net.sf.json.JSONObject json)
          Constructor that fills with data directly.
 
Method Summary
 boolean equals(Object obj)
           
 void fromJson(net.sf.json.JSONObject json)
          Takes a JSON object and fills its internal data-structure.
 String getNumber()
          The patchset number.
 String getRef()
          Gets the refspec, if it exists.
 String getRevision()
          Git commit-ish for this patchset.
 Account getUploader()
          The one who uploaded the patch-set.
 int hashCode()
           
 void setNumber(String number)
          The patchset number.
 void setRef(String ref)
          Sets the refspec.
 void setRevision(String revision)
          Git commit-ish for this patchset.
 void setUploader(Account uploader)
          The one who uploaded the patch-set.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PatchSet

public PatchSet()
Default constructor.


PatchSet

public PatchSet(net.sf.json.JSONObject json)
Constructor that fills with data directly.

Parameters:
json - the JSON object with corresponding data.
Method Detail

fromJson

public void fromJson(net.sf.json.JSONObject json)
Description copied from interface: GerritJsonDTO
Takes a JSON object and fills its internal data-structure.

Specified by:
fromJson in interface GerritJsonDTO
Parameters:
json - the JSON Object.

getNumber

public String getNumber()
The patchset number.

Returns:
the number.

setNumber

public void setNumber(String number)
The patchset number.

Parameters:
number - the number.

getRevision

public String getRevision()
Git commit-ish for this patchset.

Returns:
the revision commit-ish.

setRevision

public void setRevision(String revision)
Git commit-ish for this patchset.

Parameters:
revision - the revision commit-ish.

getRef

public String getRef()
Gets the refspec, if it exists. This value in the JSON stream-events data was introduced some version after the stream-events command was, so it might not exist for all stream-events versions of Gerrit.

Returns:
the refspec.

setRef

public void setRef(String ref)
Sets the refspec.

Parameters:
ref - the refspec.

getUploader

public Account getUploader()
The one who uploaded the patch-set.

Returns:
the account of the uploader.

setUploader

public void setUploader(Account uploader)
The one who uploaded the patch-set.

Parameters:
uploader - the account of the uploader.

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2004-2012 Hudson. All Rights Reserved.