java.lang.Object
com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.data.TriggeredItemEntity

public class TriggeredItemEntity extends Object
Wrapper class for smoother serialization of Run and Job.
Author:
Robert Sandell <robert.sandell@sonyericsson.com>
  • Constructor Details

    • TriggeredItemEntity

      public TriggeredItemEntity(Integer buildNumber, String projectId)
      Standard constructor.
      Parameters:
      buildNumber - a buildNumber
      projectId - a project's full name.
    • TriggeredItemEntity

      public TriggeredItemEntity(Job project, Run build)
      Standard Constructor.
      Parameters:
      project - a project.
      build - a build.
    • TriggeredItemEntity

      public TriggeredItemEntity(Run build)
      Easy Constructor. The project will be set from Run.getParent().
      Parameters:
      build - a build.
    • TriggeredItemEntity

      public TriggeredItemEntity(Job project)
      Easy Constructor.
      Parameters:
      project - a project.
    • TriggeredItemEntity

      public TriggeredItemEntity()
      Default constructor.
  • Method Details

    • hasBuild

      public boolean hasBuild()
      If this object contains a build.
      Returns:
      true if so.
    • getBuild

      public Run getBuild()
      The build. If this object is newly deserialized, the build will be looked up via getBuildNumber().
      Returns:
      the build.
    • setBuild

      public void setBuild(Run build)
      The build.
      Parameters:
      build - the build.
    • getProject

      public Job getProject()
      The project. If this object is newly deserialized, the project will be looked up from getProjectId()
      Returns:
      the project.
    • setProject

      public void setProject(Job project)
      The project.
      Parameters:
      project - the project.
    • getBuildNumber

      public Integer getBuildNumber()
      The buildnumber if any yet.
      Returns:
      the build number.
    • setBuildNumber

      public void setBuildNumber(Integer buildNumber)
      The buildnumber if any yet. Do not use this method unless you are a serializer!
      Parameters:
      buildNumber - the build number.
    • getProjectId

      public String getProjectId()
      The project's id.
      Returns:
      the id.
      See Also:
    • setProjectId

      public void setProjectId(String projectId)
      The project's id. Do not use this method unless you are a serializer!
      Parameters:
      projectId - the id.
      See Also:
    • equals

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

      public boolean isSameBuild(int otherBuildNumber, String otherParentName)
      If this object represents the same build as specified by parameters.
      Parameters:
      otherBuildNumber - build number
      otherParentName - project full name
      Returns:
      true if it is so.
    • equals

      @Deprecated public boolean equals(@CheckForNull Run<?,?> aBuild)
      Deprecated.
      If this object represents the same build as aBuild.
      Parameters:
      aBuild - the build to compare.
      Returns:
      true if it is so.
    • equals

      public boolean equals(String aProjectFullname)
      If this object represents the same project as aProjectFullname.
      Parameters:
      aProjectFullname - the project to compare.
      Returns:
      true if it is so.
    • equals

      @Deprecated public boolean equals(Job other)
      Deprecated.
      Use equals(String) instead
      If this object represents the same project as other.
      Parameters:
      other - the project to compare.
      Returns:
      true if it is so.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object