Class ItemKind

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

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public final class ItemKind extends Object
The kind of the item a permission window names (D-71): the item's TopLevelItemDescriptor id, display name and icon, recorded when the request is created and copied to the grant at approval. Approval compares the recorded descriptor id with the item's current one, so a window is never approved on an item that was replaced by one of another kind under the same name.

Immutable; persisted by XStream as three strings inside the grant request and grant files.

  • Constructor Summary

    Constructors
    Constructor
    Description
    ItemKind(String descriptorId, String displayName, String iconClassName)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    The descriptor id, for example org.jenkinsci.plugins.workflow.job.WorkflowJob, hudson.model.FreeStyleProject or com.cloudbees.hudson.plugins.folder.Folder.
    The descriptor display name when recorded, for example "Pipeline", "Freestyle project" or "Folder".
    The descriptor's icon class name, or null when it has none.
    int
     
    static ItemKind
    of(Item item)
    The kind of item, read from its descriptor, or null when the item is not a top-level item (a sub-item of a job, such as a matrix configuration or a Maven module, which is part of that job and cannot be named by a window).
     

    Methods inherited from class java.lang.Object

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

    • ItemKind

      public ItemKind(String descriptorId, String displayName, @CheckForNull String iconClassName)
  • Method Details

    • of

      @CheckForNull public static ItemKind of(@CheckForNull Item item)
      The kind of item, read from its descriptor, or null when the item is not a top-level item (a sub-item of a job, such as a matrix configuration or a Maven module, which is part of that job and cannot be named by a window).
    • getDescriptorId

      public String getDescriptorId()
      The descriptor id, for example org.jenkinsci.plugins.workflow.job.WorkflowJob, hudson.model.FreeStyleProject or com.cloudbees.hudson.plugins.folder.Folder.
    • getDisplayName

      public String getDisplayName()
      The descriptor display name when recorded, for example "Pipeline", "Freestyle project" or "Folder".
    • getIconClassName

      @CheckForNull public String getIconClassName()
      The descriptor's icon class name, or null when it has none.
    • 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