org.jenkinsci.plugins.darcs
Class DarcsChangeSetList

java.lang.Object
  extended by hudson.scm.ChangeLogSet<DarcsChangeSet>
      extended by org.jenkinsci.plugins.darcs.DarcsChangeSetList
All Implemented Interfaces:
Iterable<DarcsChangeSet>

public class DarcsChangeSetList
extends ChangeLogSet<DarcsChangeSet>

List of change set that went into a particular build.

Author:
Sven Strittmatter

Nested Class Summary
 
Nested classes/interfaces inherited from class hudson.scm.ChangeLogSet
ChangeLogSet.AffectedFile, ChangeLogSet.Entry
 
Field Summary
private static int BYTE_MASK
          Used to mask bytes.
private  List<DarcsChangeSet> changeSets
          Set of the changes.
private  String digest
          Lazy computed digest over all change set hashes.
private static String KIND
          Kind description string.
 
Fields inherited from class hudson.scm.ChangeLogSet
build
 
Constructor Summary
DarcsChangeSetList()
          Convenience constructor with empty change set list.
DarcsChangeSetList(AbstractBuild build, List<DarcsChangeSet> changes)
          Constructs with build and changes.
DarcsChangeSetList(List<DarcsChangeSet> changes)
          Constructs without build.
 
Method Summary
private  String calcDigest()
          Calculates md5 digest over all changesets darcs hashes.
 String digest()
          Returns the digest for the whole change set.
 boolean equals(Object object)
           
 List<DarcsChangeSet> getChangeSets()
          Returns the change set list.
 String getKind()
          Returns the kind as string.
 int hashCode()
           
 boolean isEmptySet()
           
 Iterator<DarcsChangeSet> iterator()
          Returns an iterator for the list.
 int size()
          Returns the count of change sets.
 String toString()
           
 
Methods inherited from class hudson.scm.ChangeLogSet
createEmpty, getItems
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

KIND

private static final String KIND
Kind description string.

See Also:
Constant Field Values

BYTE_MASK

private static final int BYTE_MASK
Used to mask bytes.

See Also:
Constant Field Values

changeSets

private final List<DarcsChangeSet> changeSets
Set of the changes.


digest

private String digest
Lazy computed digest over all change set hashes.

Constructor Detail

DarcsChangeSetList

public DarcsChangeSetList()
Convenience constructor with empty change set list.


DarcsChangeSetList

public DarcsChangeSetList(List<DarcsChangeSet> changes)
Constructs without build.

Parameters:
changes - list of patches

DarcsChangeSetList

public DarcsChangeSetList(AbstractBuild build,
                          List<DarcsChangeSet> changes)
Constructs with build and changes.

Parameters:
build - current build associated with change set
changes - list of patches
Method Detail

isEmptySet

public boolean isEmptySet()
Specified by:
isEmptySet in class ChangeLogSet<DarcsChangeSet>

iterator

public Iterator<DarcsChangeSet> iterator()
Returns an iterator for the list.

Returns:
change set iterator

size

public int size()
Returns the count of change sets.

Returns:
size of changes

getChangeSets

public List<DarcsChangeSet> getChangeSets()
Returns the change set list.

Returns:
change set list

getKind

public String getKind()
Returns the kind as string.

Overrides:
getKind in class ChangeLogSet<DarcsChangeSet>
Returns:
"darcs"

calcDigest

private String calcDigest()
Calculates md5 digest over all changesets darcs hashes. Inspired by http://www.stratos.me/2008/05/java-string-calculate-md5/

Returns:
md5 hashed string

digest

public String digest()
Returns the digest for the whole change set. Lazy computes the digest one time.

Returns:
md5 hashed digest

equals

public boolean equals(Object object)
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-2013 weltraumschaf.de. All Rights Reserved.