Class OwnershipDescriptionHelper

java.lang.Object
com.synopsys.arc.jenkins.plugins.ownership.util.OwnershipDescriptionHelper

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class OwnershipDescriptionHelper extends Object
Provides handlers for ownership description.
Since:
0.4 - Public API class, TODO - Class API is restricted, use OwnershipDescription instead
Author:
Oleg Nenashev
See Also:
  • Method Details

    • getOwnerID

      @Nonnull @Deprecated public static String getOwnerID(@Nonnull OwnershipDescription descr)
      Gets ID of the primary owner.
      Parameters:
      descr - Ownership description
      Returns:
      userId of the primary owner. The result will be "unknown" if the user is not specified.
    • getPrimaryOwnerId

      @Nonnull public static String getPrimaryOwnerId(@Nonnull OwnershipDescription descr)
      Gets id of the primary owner.
      Parameters:
      descr - Ownership description
      Returns:
      userId of the primary owner. The result will be "unknown" if the user is not specified.
    • getOwnerEmail

      @Nonnull @Deprecated public static String getOwnerEmail(@Nonnull OwnershipDescription descr)
      Gets owner's e-mail.
      Parameters:
      descr - Ownership description
      Returns:
      Owner's e-mail or empty string if it is not available
    • getPrimaryOwnerEmail

      @Nonnull public static String getPrimaryOwnerEmail(@Nonnull OwnershipDescription descr)
      Gets e-mail of the primary owner.
      Parameters:
      descr - Ownership description
      Returns:
      Owner's e-mail or empty string if it is not available
      Since:
      0.9
    • getSecondaryOwnerIds

      @Nonnull public static Set<String> getSecondaryOwnerIds(@Nonnull OwnershipDescription descr, boolean includeOwner)
      Gets a comma-separated list of co-owners.
      Parameters:
      descr - Ownership description
      includeOwner - Include owner to the list
      Returns:
      Set of co-owner user IDs
      Since:
      0.9
    • getCoOwnerIDs

      @Deprecated @Nonnull public static String getCoOwnerIDs(@Nonnull OwnershipDescription descr)
      Gets a comma-separated list of co-owners. Owner will be also considered as co-owner.
      Parameters:
      descr - Ownership description
      Returns:
      List of co-owner user IDs
    • getAllOwnerIdsString

      @Nonnull public static String getAllOwnerIdsString(@Nonnull OwnershipDescription descr)
      Gets a comma-separated list of primary and secondary owners.
      Parameters:
      descr - Ownership description
      Returns:
      String containing comma-separated list of owner user IDs
      Since:
      0.9
    • getSecondaryOwnerEmails

      public static Set<String> getSecondaryOwnerEmails(@Nonnull OwnershipDescription descr, boolean includeOwner)
      Gets e-mails of secondary owners (including owner if required).
      Parameters:
      descr - Ownership description
      includeOwner - Include owner to the list
      Returns:
      Set of secondary owner emails
      Since:
      0.9
    • getAllOwnerEmailsString

      public static String getAllOwnerEmailsString(@Nonnull OwnershipDescription descr)
      Gets e-mails of secondary owners (including primary owner).
      Parameters:
      descr - Ownership description
      Returns:
      Comma-separated list of secondary owner e-mails (may be empty)
      Since:
      0.9