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 hudson.scm.ChangeLogSet.Entry

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

The object should be treated like an immutable object.

Author:
Sven Strittmatter

Constructor Summary
DarcsChangeSet()
           
 
Method Summary
 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.
 hudson.model.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<hudson.scm.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(hudson.scm.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(hudson.scm.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
 

Constructor Detail

DarcsChangeSet

public DarcsChangeSet()
Method Detail

getAuthor

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

Specified by:
getAuthor in class hudson.scm.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 hudson.scm.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 hudson.scm.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(hudson.scm.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(hudson.scm.ChangeLogSet parent)
Overrides:
setParent in class hudson.scm.ChangeLogSet.Entry

getEditTypes

public List<hudson.scm.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


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