Class Tag

java.lang.Object
sonia.scm.repository.Tag

public final class Tag extends Object
Represents a tag in a repository.
Since:
1.18
  • Field Details

  • Constructor Details

    • Tag

      public Tag(String name, String revision)
    • Tag

      public Tag(String name, String revision, Long date)
      Constructs a new tag.
      Parameters:
      name - name of the tag
      revision - tagged revision
      date - the creation timestamp (milliseconds) of the tag
      Since:
      2.5.0
    • Tag

      public Tag(String name, String revision, Long date, Boolean deletable)
      Constructs a new tag.
      Parameters:
      name - name of the tag
      revision - tagged revision
      date - the creation timestamp (milliseconds) of the tag
      deletable - whether this tag can be deleted
      Since:
      2.11.0
  • Method Details

    • getDate

      public Optional<Long> getDate()
      Depending on the underlying source code management system (like git or hg) and depending on the type of this tag (for example git has lightweight and annotated tags), this date has different meaning. For annotated tags in git, this is the date the tag was created. In other cases (for lightweight tags in git or all tags in hg) this is the date of the referenced changeset.

      Please note, that the date is retrieved in a best-effort fashion. In certain situations (for example if this tag is announced in a pre or post receive hook), it might not be available. In these cases, this method returns an empty Optional.

      Since:
      2.5.0
    • addSignature

      public void addSignature(Signature signature)