Class CredentialsSelectHelper.ItemContextResolver
java.lang.Object
com.cloudbees.plugins.credentials.CredentialsSelectHelper.ContextResolver
com.cloudbees.plugins.credentials.CredentialsSelectHelper.ItemContextResolver
- All Implemented Interfaces:
ExtensionPoint
- Enclosing class:
- CredentialsSelectHelper
@Extension
public static class CredentialsSelectHelper.ItemContextResolver
extends CredentialsSelectHelper.ContextResolver
A
CredentialsSelectHelper.ContextResolver
for Item
instances resolvable by Jenkins.getItemByFullName(String)
.- Since:
- 2.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
Fields inherited from class com.cloudbees.plugins.credentials.CredentialsSelectHelper.ContextResolver
NONE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetContext
(String token) Maps a token fromCredentialsSelectHelper.ContextResolver.getToken(ModelObject)
back to its originalModelObject
.Returns a human readable description of the type of context objects that this resolver resolves.getToken
(ModelObject context) Maps a context object (aModelObject
) into a token that can be used to recover the context.Methods inherited from class com.cloudbees.plugins.credentials.CredentialsSelectHelper.ContextResolver
displayName
-
Constructor Details
-
ItemContextResolver
public ItemContextResolver()
-
-
Method Details
-
getToken
Maps a context object (aModelObject
) into a token that can be used to recover the context.- Specified by:
getToken
in classCredentialsSelectHelper.ContextResolver
- Parameters:
context
- theModelObject
.- Returns:
- a token if this
CredentialsSelectHelper.ContextResolver
can recover the object ornull
if theModelObject
type is not supported by thisCredentialsSelectHelper.ContextResolver
.
-
getContext
Maps a token fromCredentialsSelectHelper.ContextResolver.getToken(ModelObject)
back to its originalModelObject
.- Specified by:
getContext
in classCredentialsSelectHelper.ContextResolver
- Parameters:
token
- the token.- Returns:
- the corresponding
ModelObject
ornull
if the object no longer exists or if the user does not have permission to access that object.
-
getDisplayName
Returns a human readable description of the type of context objects that this resolver resolves.- Specified by:
getDisplayName
in classCredentialsSelectHelper.ContextResolver
- Returns:
- a human readable description of the type of context objects that this resolver resolves.
-