Class Changeset

java.lang.Object
sonia.scm.BasicPropertiesAware
sonia.scm.repository.Changeset
All Implemented Interfaces:
Serializable, Cloneable, LastModifiedAware, ModelObject, PropertiesAware, TypedObject, Validateable

public class Changeset extends BasicPropertiesAware implements ModelObject
Represents a changeset/commit of a repository.
See Also:
  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCreationDate

      public Long getCreationDate()
      Returns a timestamp of the creation date of the Changeset.
      Specified by:
      getCreationDate in interface ModelObject
    • setCreationDate

      public void setCreationDate(Long timestamp)
      Specified by:
      setCreationDate in interface ModelObject
    • getAuthor

      public Person getAuthor()
      Returns the author of the changeset.
    • getBranches

      public List<String> getBranches()
      Returns the branches of the changeset. In the most cases a changeset is only related to one branch, but in the case of receive hooks it is possible that a changeset is related to more than a branch.
      Returns:
      branches of the changeset
    • getDate

      public Long getDate()
      Returns the creation date of the changeset.
    • getDescription

      public String getDescription()
      Return the description (commit message) of the changeset.
    • getId

      public String getId()
      Returns the id of the changeset.
      Specified by:
      getId in interface ModelObject
    • setLastModified

      public void setLastModified(Long timestamp)
      Specified by:
      setLastModified in interface ModelObject
    • getLastModified

      public Long getLastModified()
      Description copied from interface: LastModifiedAware
      Returns a timestamp of the last modified date.
      Specified by:
      getLastModified in interface LastModifiedAware
    • getType

      public String getType()
      Description copied from interface: TypedObject
      Returns the type of the object.
      Specified by:
      getType in interface TypedObject
    • getParents

      public List<String> getParents()
      Return the ids of the parent changesets.
      Returns:
      Since:
      1.11
    • getTags

      public List<String> getTags()
      Returns tags associated with this changeset.
      Returns:
      tags of the changeset
    • getContributors

      public Collection<Contributor> getContributors()
      Returns collection of contributors for this changeset.
      Returns:
      collection of contributors
      Since:
      2.1.0
    • isValid

      public boolean isValid()
      Returns true if the changeset is valid.
      Specified by:
      isValid in interface Validateable
      Returns:
      true if the changeset is valid
    • setAuthor

      public void setAuthor(Person author)
      Sets the author of the changeset.
    • setBranches

      public void setBranches(List<String> branches)
      Sets the branches of the changeset.
    • setDate

      public void setDate(Long date)
      Sets the date of the changeset.
    • setDescription

      public void setDescription(String description)
      Sets the description (commit message) of the changeset.
    • setId

      public void setId(String id)
      Sets the id of the changeset.
    • setParents

      public void setParents(List<String> parents)
      Sets the parents of the changeset.
      Parameters:
      parents - parents of the changeset
      Since:
      1.11
    • setTags

      public void setTags(List<String> tags)
      Sets the tags of the changeset
    • setContributors

      public void setContributors(Collection<Contributor> contributors)
      Sets the collection of contributors.
      Since:
      2.1.0
    • addContributor

      public void addContributor(Contributor contributor)
      Adds a contributor to the list of contributors.
      Since:
      2.1.0
    • addContributors

      public void addContributors(Collection<Contributor> contributors)
      Adds all contributors from the given collection to the list of contributors.
      Since:
      2.1.0
    • setSignatures

      public void setSignatures(Collection<Signature> signatures)
      Sets a collection of signatures which belong to this changeset.
      Parameters:
      signatures - collection of signatures
      Since:
      2.4.0
    • getSignatures

      public List<Signature> getSignatures()
      Returns a immutable list of signatures.
      Returns:
      signatures
      Since:
      2.4.0
    • addSignature

      public void addSignature(Signature signature)
      Adds a signature to the list of signatures.
      Parameters:
      signature -
      Since:
      2.4.0