本文整理了Java中jenkins.model.Jenkins.getDisplayName()
方法的一些代码示例,展示了Jenkins.getDisplayName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jenkins.getDisplayName()
方法的具体详情如下:
包路径:jenkins.model.Jenkins
类名称:Jenkins
方法名:getDisplayName
暂无
代码示例来源:origin: org.jenkins-ci.plugins/aws-credentials
private static AssumeRoleRequest createAssumeRoleRequest(@QueryParameter("iamRoleArn") String iamRoleArn) {
return new AssumeRoleRequest()
.withRoleArn(iamRoleArn)
.withDurationSeconds(STS_CREDENTIALS_DURATION_SECONDS)
.withRoleSessionName(Jenkins.getActiveInstance().getDisplayName());
}
代码示例来源:origin: org.jenkins-ci.plugins/credentials
/**
* Returns the display name of the {@link #getContext()} of this {@link CredentialsStore}. The default
* implementation can handle both {@link Item} and {@link ItemGroup} as long as these are accessible from
* {@link Jenkins}, and {@link User}. If the {@link CredentialsStore} provides an alternative
* {@link #getContext()} that is outside of the normal tree then that implementation is responsible for
* overriding this method to produce the correct display name.
*
* @return the display name.
* @since 2.0
*/
public final String getContextDisplayName() {
ModelObject context = getContext();
if (context instanceof Item) {
return ((Item) context).getFullDisplayName();
} else if (context instanceof Jenkins) {
return ((Jenkins) context).getDisplayName();
} else if (context instanceof ItemGroup) {
return ((ItemGroup) context).getFullDisplayName();
} else if (context instanceof User) {
return Messages.CredentialsStoreAction_UserDisplayName(context.getDisplayName());
} else {
return context.getDisplayName();
}
}
代码示例来源:origin: jenkinsci/credentials-plugin
/**
* Returns the display name of the {@link #getContext()} of this {@link CredentialsStore}. The default
* implementation can handle both {@link Item} and {@link ItemGroup} as long as these are accessible from
* {@link Jenkins}, and {@link User}. If the {@link CredentialsStore} provides an alternative
* {@link #getContext()} that is outside of the normal tree then that implementation is responsible for
* overriding this method to produce the correct display name.
*
* @return the display name.
* @since 2.0
*/
public final String getContextDisplayName() {
ModelObject context = getContext();
if (context instanceof Item) {
return ((Item) context).getFullDisplayName();
} else if (context instanceof Jenkins) {
return ((Jenkins) context).getDisplayName();
} else if (context instanceof ItemGroup) {
return ((ItemGroup) context).getFullDisplayName();
} else if (context instanceof User) {
return Messages.CredentialsStoreAction_UserDisplayName(context.getDisplayName());
} else {
return context.getDisplayName();
}
}
内容来源于网络,如有侵权,请联系作者删除!