Class SCMSource.SourceByItem

java.lang.Object
jenkins.scm.api.SCMSource.SourceByItem
All Implemented Interfaces:
ExtensionPoint
Enclosing class:
SCMSource

public abstract static class SCMSource.SourceByItem extends Object implements ExtensionPoint
Means of locating a head given an item.
Since:
2.0.1
  • Constructor Details

    • SourceByItem

      public SourceByItem()
  • Method Details

    • getSource

      @CheckForNull public abstract SCMSource getSource(Item item)
      Checks whether a given item corresponds to a particular SCMSource.
      Parameters:
      item - such as a child of an SCMSourceOwner
      Returns:
      a corresponding SCMSource, or null if this information is unavailable
    • findSource

      @CheckForNull public static SCMSource findSource(Item item)
      Runs all registered implementations.
      Parameters:
      item - an item, such as a branch project
      Returns:
      the corresponding head, if known