Class Approvers

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

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class Approvers extends Object
Helpers for a designated approver set (D-37): order-preserving, duplicate-free, trimmed, blank entries dropped. Shared by the request models and the policy layer.
  • Method Details

    • normalize

      public static List<String> normalize(List<String> approvers)
      Trimmed, de-duplicated (first occurrence wins) copy with blank entries removed.
    • of

      public static List<String> of(String approver)
      The one-element set for a single approver id; empty for null/blank.
    • sameUser

      public static boolean sameUser(String a, String b)
      Whether two user ids name the same user under Jenkins' configured user id strategy (SPEC item 3; security-08 S-12), for example case-insensitively by default.
    • contains

      public static boolean contains(List<String> ids, String userId)
      Whether userId is a member of ids under the user id strategy.
    • display

      public static String display(List<String> approvers)
      Members joined by ", " for display; empty string for an empty set.
    • csv

      public static String csv(List<String> approvers)
      Members joined by ";", the CSV form of the approver column (D-37).