org.jenkinsci.plugins.darcs
Class DarcsChangeSet

java.lang.Object
  extended by hudson.scm.ChangeLogSet.Entry
      extended by org.jenkinsci.plugins.darcs.DarcsChangeSet

public class DarcsChangeSet
extends ChangeLogSet.Entry

Represents a change set (aka. a patch in Darcs).

The object should be treated like an immutable object.

Author:
Sven Strittmatter

Field Summary
private  List<String> added
          Filles added by this patch.
private  String author
          The patch author.
private  String comment
          The patch long comment.
private  String date
          The patch date in UTC.
private  List<String> deleted
          Filles deleted by this patch.
private  String hash
          The patches unique has.
private  boolean inverted
          Whether it is an inversion of an other patch.
private  String localDate
          Localized patch date.
private  List<String> modified
          Filles modified by this patch.
private  String name
          The patch name.
 
Constructor Summary
DarcsChangeSet()
           
 
Method Summary
private static boolean equal(Object a, Object b)
          Helper which respects null values.
 boolean equals(Object obj)
           
 List<String> getAddedPaths()
          Gets all the files that were added.
 List<String> getAffectedPaths()
          Returns a lazy computed list of all files affected by this patch.
 User getAuthor()
          Returns the author as User object.
 String getComment()
          Returns the patch comment.
 String getDate()
          Returns the patch date as string.
 List<String> getDeletedPaths()
          Gets all the files that were deleted.
 List<EditType> getEditTypes()
          Returns all three variations of EditType.
 String getHash()
          Returns the unique hash string of the patch.
 String getLocalDate()
          Returns the localized date string.
 List<String> getModifiedPaths()
          Gets all the files that were modified.
 String getMsg()
          Method for fulfill the interface.
 String getName()
          Returns the patch name.
 List<String> getPaths(EditType kind)
          Convenience method for getting affected paths by type.
 String getPlainAuthor()
          Returns the plain author string used in the Darcs repository.
 int hashCode()
           
 boolean isInverted()
          Returns whether the patch is inverted or not.
 void setAuthor(String anAuthor)
          Sets the author string from Darcs.
 void setComment(String aComment)
          Sets the comment string.
 void setDate(String aDate)
          Sets the date string.
 void setHash(String aHash)
          Sets the hash string.
 void setInverted(boolean isInverted)
          Sets the inverted flag.
 void setLocalDate(String aLocalDate)
          Sets the localized date string.
 void setName(String aName)
          Sets the patch name.
protected  void setParent(ChangeLogSet parent)
           
 String toString()
           
 
Methods inherited from class hudson.scm.ChangeLogSet.Entry
getAffectedFiles, getCommitId, getMsgAnnotated, getMsgEscaped, getParent, getTimestamp
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

author

private String author
The patch author.


date

private String date
The patch date in UTC.


localDate

private String localDate
Localized patch date.


inverted

private boolean inverted
Whether it is an inversion of an other patch.


hash

private String hash
The patches unique has.


name

private String name
The patch name.


comment

private String comment
The patch long comment.


added

private List<String> added
Filles added by this patch.


deleted

private List<String> deleted
Filles deleted by this patch.


modified

private List<String> modified
Filles modified by this patch.

Constructor Detail

DarcsChangeSet

public DarcsChangeSet()
Method Detail

getAuthor

@Exported
public User getAuthor()
Returns the author as User object. If you want the parsed author string from Darcs call getPlainAuthor().

Specified by:
getAuthor in class ChangeLogSet.Entry
Returns:
a Jenkins user object

getPlainAuthor

public String getPlainAuthor()
Returns the plain author string used in the Darcs repository.

Returns:
author name

getComment

@Exported
public String getComment()
Returns the patch comment.

Returns:
comment message

getDate

@Exported
public String getDate()
Returns the patch date as string.

Returns:
date string in UTC

getHash

@Exported
public String getHash()
Returns the unique hash string of the patch.

Returns:
hash string

isInverted

@Exported
public boolean isInverted()
Returns whether the patch is inverted or not.

Returns:
true if it is an inverse patch, else false

getLocalDate

@Exported
public String getLocalDate()
Returns the localized date string.

Returns:
local date string in UTC

getName

@Exported
public String getName()
Returns the patch name.

Returns:
the patch name

getMsg

public String getMsg()
Method for fulfill the interface. Delegates to getComment().

Specified by:
getMsg in class ChangeLogSet.Entry
Returns:
same as getComment()

setAuthor

public void setAuthor(String anAuthor)
Sets the author string from Darcs. Thus this object should be treated as immutable, this setter should only be called from the DarcsChangeLogParser.

Parameters:
anAuthor - author name string

setComment

public void setComment(String aComment)
Sets the comment string. Thus this object should be treated as immutable, this setter should only be called from the DarcsChangeLogParser.

Parameters:
aComment - patch comment message

setDate

public void setDate(String aDate)
Sets the date string. Thus this object should be treated as immutable, this setter should only be called from the DarcsChangeLogParser.

Parameters:
aDate - date in UTC

setHash

public void setHash(String aHash)
Sets the hash string. Thus this object should be treated as immutable, this setter should only be called from the DarcsChangeLogParser.

Parameters:
aHash - hash string

setInverted

public void setInverted(boolean isInverted)
Sets the inverted flag. Thus this object should be treated as immutable, this setter should only be called from the DarcsChangeLogParser.

Parameters:
isInverted - true if it is an inverse patch, else false

setLocalDate

public void setLocalDate(String aLocalDate)
Sets the localized date string. Thus this object should be treated as immutable, this setter should only be called from the DarcsChangeLogParser.

Parameters:
aLocalDate - date in UTC

setName

public void setName(String aName)
Sets the patch name. Thus this object should be treated as immutable, this setter should only be called from the DarcsChangeLogParser.

Parameters:
aName - patch name

getAffectedPaths

public List<String> getAffectedPaths()
Returns a lazy computed list of all files affected by this patch.

Specified by:
getAffectedPaths in class ChangeLogSet.Entry
Returns:
the list is recalculated on each call

getAddedPaths

@Exported
public List<String> getAddedPaths()
Gets all the files that were added.

Returns:
modifiable list

getDeletedPaths

@Exported
public List<String> getDeletedPaths()
Gets all the files that were deleted.

Returns:
modifiable list

getModifiedPaths

@Exported
public List<String> getModifiedPaths()
Gets all the files that were modified.

Returns:
modifiable list

getPaths

public List<String> getPaths(EditType kind)
Convenience method for getting affected paths by type.

Parameters:
kind - one of EditType.ADD, EditType.EDIT, EditType.DELETE
Returns:
list associated to the edit type

setParent

protected void setParent(ChangeLogSet parent)
Overrides:
setParent in class ChangeLogSet.Entry

getEditTypes

public List<EditType> getEditTypes()
Returns all three variations of EditType. Placed here to simplify access from views.

Returns:
available edit types

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

equal

private static boolean equal(Object a,
                             Object b)
Helper which respects null values.

Parameters:
a - first object to compare
b - second object to compare
Returns:
true if a and b are equal, else false


Copyright © 2004-2013 weltraumschaf.de. All Rights Reserved.