jenkins.model.Jenkins.getDisplayName()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(2.5k)|赞(0)|评价(0)|浏览(353)

本文整理了Java中jenkins.model.Jenkins.getDisplayName()方法的一些代码示例,展示了Jenkins.getDisplayName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Jenkins.getDisplayName()方法的具体详情如下:
包路径:jenkins.model.Jenkins
类名称:Jenkins
方法名:getDisplayName

Jenkins.getDisplayName介绍

暂无

代码示例

代码示例来源:origin: org.jenkins-ci.plugins/aws-credentials

  1. private static AssumeRoleRequest createAssumeRoleRequest(@QueryParameter("iamRoleArn") String iamRoleArn) {
  2. return new AssumeRoleRequest()
  3. .withRoleArn(iamRoleArn)
  4. .withDurationSeconds(STS_CREDENTIALS_DURATION_SECONDS)
  5. .withRoleSessionName(Jenkins.getActiveInstance().getDisplayName());
  6. }

代码示例来源:origin: org.jenkins-ci.plugins/credentials

  1. /**
  2. * Returns the display name of the {@link #getContext()} of this {@link CredentialsStore}. The default
  3. * implementation can handle both {@link Item} and {@link ItemGroup} as long as these are accessible from
  4. * {@link Jenkins}, and {@link User}. If the {@link CredentialsStore} provides an alternative
  5. * {@link #getContext()} that is outside of the normal tree then that implementation is responsible for
  6. * overriding this method to produce the correct display name.
  7. *
  8. * @return the display name.
  9. * @since 2.0
  10. */
  11. public final String getContextDisplayName() {
  12. ModelObject context = getContext();
  13. if (context instanceof Item) {
  14. return ((Item) context).getFullDisplayName();
  15. } else if (context instanceof Jenkins) {
  16. return ((Jenkins) context).getDisplayName();
  17. } else if (context instanceof ItemGroup) {
  18. return ((ItemGroup) context).getFullDisplayName();
  19. } else if (context instanceof User) {
  20. return Messages.CredentialsStoreAction_UserDisplayName(context.getDisplayName());
  21. } else {
  22. return context.getDisplayName();
  23. }
  24. }

代码示例来源:origin: jenkinsci/credentials-plugin

  1. /**
  2. * Returns the display name of the {@link #getContext()} of this {@link CredentialsStore}. The default
  3. * implementation can handle both {@link Item} and {@link ItemGroup} as long as these are accessible from
  4. * {@link Jenkins}, and {@link User}. If the {@link CredentialsStore} provides an alternative
  5. * {@link #getContext()} that is outside of the normal tree then that implementation is responsible for
  6. * overriding this method to produce the correct display name.
  7. *
  8. * @return the display name.
  9. * @since 2.0
  10. */
  11. public final String getContextDisplayName() {
  12. ModelObject context = getContext();
  13. if (context instanceof Item) {
  14. return ((Item) context).getFullDisplayName();
  15. } else if (context instanceof Jenkins) {
  16. return ((Jenkins) context).getDisplayName();
  17. } else if (context instanceof ItemGroup) {
  18. return ((ItemGroup) context).getFullDisplayName();
  19. } else if (context instanceof User) {
  20. return Messages.CredentialsStoreAction_UserDisplayName(context.getDisplayName());
  21. } else {
  22. return context.getDisplayName();
  23. }
  24. }

相关文章

Jenkins类方法