Class BitbucketBuildStatus

java.lang.Object
com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketBuildStatus
Direct Known Subclasses:
BitbucketServerBuildStatus

public class BitbucketBuildStatus extends Object
  • Constructor Details

    • BitbucketBuildStatus

      @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public BitbucketBuildStatus()
    • BitbucketBuildStatus

      public BitbucketBuildStatus(String hash, String description, @NonNull BitbucketBuildStatus.Status state, String url, @NonNull String key, String name, @Nullable String refname)
    • BitbucketBuildStatus

      public BitbucketBuildStatus(@NonNull BitbucketBuildStatus other)
      Copy constructor.
      Parameters:
      other - from copy to.
  • Method Details

    • getHash

      public String getHash()
    • setHash

      public void setHash(String hash)
    • getDescription

      public String getDescription()
    • setDescription

      public void setDescription(String description)
    • getState

      public BitbucketBuildStatus.Status getState()
    • setState

      public void setState(BitbucketBuildStatus.Status state)
    • getUrl

      public String getUrl()
    • setUrl

      public void setUrl(String url)
    • getKey

      public String getKey()
    • setKey

      public void setKey(String key)
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • getRefname

      public String getRefname()
    • setRefname

      public void setRefname(String refname)
    • getBuildDuration

      public long getBuildDuration()
    • setBuildDuration

      public void setBuildDuration(long buildDuration)
    • getBuildNumber

      public int getBuildNumber()
    • setBuildNumber

      public void setBuildNumber(int buildNumber)
    • setParent

      public void setParent(String parent)
    • getParent

      public String getParent()
    • getOptionalData

      public Map<String,Object> getOptionalData()
      This represent additional informations contributed by BitbucketBuildStatusCustomizers.

      The contents of this map will be added to the root of the sent payload.

      For example:

       buildStatus.addOptionalData("testResults", new TestResult(1, 2, 3));
       buildStatus.addOptionalData("optX", true);
       
      Will be serialised as:
       {
           "description": "The build is in progress..."
           ...
           "testResult": {
               "successful": 5,
               "failed": 2,
               "skipped": 1
           },
           "optX": true
       }
       
      Returns:
      an unmodifiable map of extra informations
    • addOptionalData

      public void addOptionalData(String attribute, Object value)
      Add a new attribute to the payload to send. If the attribute has already been valued than it is ignored.
      Parameters:
      attribute - attribute of build status, refer to the Bitbucket API
      value - bean to associate to the given attribute name
      See Also:
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

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