Class PendingCount

java.lang.Object
io.jenkins.plugins.batchcontrol.model.PendingCount

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class PendingCount extends Object
How many PENDING requests of one kind concern a viewer (D-61): the requests awaiting their decision as a designated approver holding BatchControl/Approve, and their own requests on which they are not a designated approver. Produced only by the countPendingFor(Authentication) methods of the policy services, so the tab badges and the sections share one rule.

Decisions come first: as soon as one request awaits the viewer's decision, getCount() is that number; otherwise it is the number of the viewer's own pending requests.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final PendingCount
    Nothing pending for the viewer.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PendingCount(int awaitingDecision, int own)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
    PENDING requests on which the viewer is a designated approver holding BatchControl/Approve.
    int
    The number to display: decisions when there are any, else own requests; 0 when nothing is pending.
    int
    The viewer's own PENDING requests that are not already counted as awaiting their decision.
    int
     
    boolean
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • NONE

      public static final PendingCount NONE
      Nothing pending for the viewer.
  • Constructor Details

    • PendingCount

      public PendingCount(int awaitingDecision, int own)
  • Method Details

    • getAwaitingDecision

      public int getAwaitingDecision()
      PENDING requests on which the viewer is a designated approver holding BatchControl/Approve.
    • getOwn

      public int getOwn()
      The viewer's own PENDING requests that are not already counted as awaiting their decision.
    • getCount

      public int getCount()
      The number to display: decisions when there are any, else own requests; 0 when nothing is pending.
    • isEmpty

      public boolean isEmpty()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object