javax.annotation.Nonnull类的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(190)

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

Nonnull介绍

暂无

代码示例

代码示例来源:origin: jenkinsci/jenkins

public static class IOTriplet implements Serializable {
  @Nonnull
  InputStream stdout,stderr;
  @Nonnull
  OutputStream stdin;
  private static final long serialVersionUID = 1L;
}
/**

代码示例来源:origin: jenkinsci/jenkins

@Override
/*
 * We need this for JENKINS-26143 -- reflective creation cannot handle setChoices(Object). See that method for context.
 */
public ParameterDefinition newInstance(@Nullable StaplerRequest req, @Nonnull JSONObject formData) throws FormException {
  String name = formData.getString("name");
  String desc = formData.getString("description");
  String choiceText = formData.getString("choices");
  return new ChoiceParameterDefinition(name, choiceText, desc);
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Replaces the occurrence of '$key' by {@code properties.get('key')}.
 *
 * <p>
 * Unlike shell, undefined variables are left as-is (this behavior is the same as Ant.)
 *
 */
@Nullable
public static String replaceMacro( @CheckForNull String s, @Nonnull Map<String,String> properties) {
  return replaceMacro(s,new VariableResolver.ByMap<String>(properties));
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Obtains the ACL associated with this object.
 *
 * @return never null.
 */
@Nonnull ACL getACL();

代码示例来源:origin: jenkinsci/jenkins

@Restricted(NoExternalUse.class)
public @Nullable ApiTokenProperty.TokenInfoAndStats getLegacyStatsOf(@Nonnull User user, @Nullable ApiTokenStore.HashedToken legacyToken) {
  ApiTokenProperty apiTokenProperty = user.getProperty(ApiTokenProperty.class);
  if (legacyToken != null) {
    ApiTokenStats.SingleTokenStats legacyStats = apiTokenProperty.getTokenStats().findTokenStatsById(legacyToken.getUuid());
    ApiTokenProperty.TokenInfoAndStats tokenInfoAndStats = new ApiTokenProperty.TokenInfoAndStats(legacyToken, legacyStats);
    return tokenInfoAndStats;
  }
  
  // in case the legacy token was revoked during the request
  return null;
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Fired when a user was successfully authenticated using credentials. It could be password or any other credentials.
 * This might be via the web UI, or via REST (using API token or Basic), or CLI (remoting, auth, ssh)
 * or any other way plugins can propose.
 * @param details details of the newly authenticated user, such as name and groups.
 */
protected void authenticated(@Nonnull UserDetails details){}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Set the search string used to narrow the filtered set of builds.
 * @param searchString The search string.
 */
public void setSearchString(@Nonnull String searchString) {
  this.searchString = searchString;
}

代码示例来源:origin: jenkinsci/jenkins

@Override
@Nonnull
public String getDisplayName() {
  return displayName;
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * @param fingerprint
 *      {@link Fingerprint} object to which this facet is going to be added to.
 * @param timestamp
 *      Timestamp when the use happened (when the facet has been created).
 */
protected FingerprintFacet(@Nonnull Fingerprint fingerprint, long timestamp) {
  assert fingerprint!=null;
  this.fingerprint = fingerprint;
  this.timestamp = timestamp;
}

代码示例来源:origin: jenkinsci/jenkins

public GroovyHookScript(String hook, @Nonnull ServletContext servletContext, @Nonnull File home, @Nonnull ClassLoader loader) {
  this.hook = hook;
  this.servletContext = servletContext;
  this.home = home;
  this.loader = loader;
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Remove item from this view.
 *
 * @return false if item not present in view, true if removed.
 * @throws IOException Removal failed.
 * @throws IllegalArgumentException View rejected to remove an item.
 */
boolean remove(@Nonnull TopLevelItem item) throws IOException, IllegalArgumentException;

代码示例来源:origin: jenkinsci/jenkins

/**
 * Add item to this view.
 *
 * @throws IOException Adding failed.
 * @throws IllegalArgumentException View rejected to add an item.
 */
void add(@Nonnull TopLevelItem item) throws IOException, IllegalArgumentException;

代码示例来源:origin: jenkinsci/jenkins

/**
 * Wraps with the error icon and the CSS class to render error message.
 * @since 1.173
 */
@Nonnull
public static String wrapToErrorSpan(@Nonnull String s) {
  s = "<span class=error style='display:inline-block'>"+s+"</span>";
  return s;
}

代码示例来源:origin: jenkinsci/jenkins

/**
   * Returns a specialized copy of T for functioning in the given node.
   */
  T forNode(@Nonnull Node node, TaskListener log) throws IOException, InterruptedException;
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * {@inheritDoc}
 */
@Override
@Nonnull
public String keyFor(@Nonnull String id) {
  return id.toLowerCase(Locale.ENGLISH);
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * {@inheritDoc}
 */
@Override
public int compare(@Nonnull String id1, @Nonnull String id2) {
  return id1.compareTo(id2);
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Called by {@link NodeProvisioner#update()} to apply this strategy against the specified state.
 * Any provisioning activities should be recorded by calling
 * {@link hudson.slaves.NodeProvisioner.StrategyState#recordPendingLaunches(java.util.Collection)}
 * This method will be called by a thread that is holding {@link hudson.slaves.NodeProvisioner#provisioningLock}
 * @param state the current state.
 * @return the decision.
 */
@Nonnull
@GuardedBy("NodeProvisioner.this")
public abstract StrategyDecision apply(@Nonnull StrategyState state);

代码示例来源:origin: jenkinsci/jenkins

/**
 * @since 1.568
 */
protected final void createEmptyChangeLog(@Nonnull File changelogFile, @Nonnull TaskListener listener, @Nonnull String rootTag) throws IOException {
  try (FileWriter w = new FileWriter(changelogFile)) {
    w.write("<"+rootTag +"/>");
  }
}

代码示例来源:origin: jenkinsci/jenkins

public Permission(@Nonnull PermissionGroup group, @Nonnull String name, 
    @CheckForNull Localizable description, @CheckForNull Permission impliedBy, @Nonnull PermissionScope scope) {
  this(group,name,description,impliedBy,true,new PermissionScope[]{scope});
  assert scope!=null;
}

代码示例来源:origin: jenkinsci/jenkins

public RemoteChannelLaunchCallable(@Nonnull String[] cmd, @Nonnull Pipe out, @Nonnull OutputStream err, 
    @CheckForNull String workDir, @Nonnull Map<String,String> envOverrides) {
  this.cmd = cmd;
  this.out = out;
  this.err = new RemoteOutputStream(err);
  this.workDir = workDir;
  this.envOverrides = envOverrides;
}

相关文章

Nonnull类方法