Package jenkins.scm.api.metadata
Class ObjectMetadataAction
- java.lang.Object
-
- hudson.model.InvisibleAction
-
- jenkins.scm.api.metadata.ObjectMetadataAction
-
- All Implemented Interfaces:
Action
,ModelObject
,Serializable
@ExportedBean public class ObjectMetadataAction extends InvisibleAction implements Serializable
Holds metadata about the object referenced by aSCMRevision
,SCMHead
,SCMSource
orSCMNavigator
.For example:
- A
SCMNavigator
implementation that corresponds to a GitHub Team could use thegetObjectUrl()
to point to the GitHub Team page, and thegetObjectDisplayName()
to provide the team name - A
SCMSource
implementation that corresponds to a GitHub Repository could use thegetObjectUrl()
to point to the GitHub repository, and thegetObjectDescription()
to provide the repository description name - A
SCMHead
implementation that corresponds to a GitHub Pull Request could use thegetObjectUrl()
to point to the pull request on GitHub, thegetObjectDisplayName()
to provide the title of the pull request andgetObjectDescription()
to provide the description of the pull request
- Since:
- 2.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ObjectMetadataAction(String objectDisplayName, String objectDescription, String objectUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getObjectDescription()
Returns the description of the object ornull
.String
getObjectDisplayName()
Returns the display name of the object ornull
.String
getObjectUrl()
Returns the external url of the object ornull
if the object does not have an external url.int
hashCode()
String
toString()
-
Methods inherited from class hudson.model.InvisibleAction
getDisplayName, getIconFileName, getUrlName
-
-
-
-
Method Detail
-
getObjectDisplayName
@Exported @CheckForNull public String getObjectDisplayName()
Returns the display name of the object ornull
. Consumers should assume the content is plain text that needs escaping withUtil.escape(String)
when being included in HTML output.- Returns:
- the display name of the object or
null
-
getObjectDescription
@Exported @CheckForNull public String getObjectDescription()
Returns the description of the object ornull
. Consumers should assume the content is plain text that needs escaping withUtil.escape(String)
when being included in HTML output.- Returns:
- the description of the object or
null
.
-
getObjectUrl
@Exported @CheckForNull public String getObjectUrl()
Returns the external url of the object ornull
if the object does not have an external url.- Returns:
- the display name of the object or
null
-
-