Refine search
/** * Works just like {@link Secret#toString()} but avoids NPE when the secret is null. * To be consistent with {@link #fromString(String)}, this method doesn't distinguish * empty password and null password. */ @Nonnull public static String toString(@CheckForNull Secret s) { return s==null ? "" : s.value; }
/** * Gets a build. * @return the build reference, or null if collected */ @CheckForNull R get();
/** * Gets path to the custom workdir path. * * @return Custom workdir path. * If {@code null}, an agent root directory path should be used instead. */ @CheckForNull public String getWorkDirPath() { return workDirPath; }
public PollingResult(@CheckForNull SCMRevisionState baseline, @CheckForNull SCMRevisionState remote, @Nonnull Change change) { if (change==null) throw new IllegalArgumentException(); this.baseline = baseline; this.remote = remote; this.change = change; }
/** * Gets the root directory of this node. * * <p> * Hudson always owns a directory on every node. This method * returns that. * * @return * null if the node is offline and hence the {@link FilePath} * object is not available. */ public abstract @CheckForNull FilePath getRootPath();
/** * Controls where the stdin of the process comes from. * By default, {@code /dev/null}. * * @return {@code this} */ @Nonnull public ProcStarter stdin(@CheckForNull InputStream in) { this.stdin = in; return this; }
/** * Convert empty string to null. */ @CheckForNull public static String fixEmpty(@CheckForNull String s) { if(s==null || s.length()==0) return null; return s; }
/** * Set all the exceptions that are allowed and indicate that the action was failed. When an exception of this * type or a child type is raised, a listener can be called ({@link #withDuringActionExceptionListener(BiFunction)}). * In any case, the retrier continues its process, retrying to perform the action again, as it was a normal failure. * @param exceptions exceptions that indicate that the action was failed. * @return this builder */ public @Nonnull Builder<V> withDuringActionExceptions(@CheckForNull Class<?>[] exceptions) { this.duringActionExceptions = exceptions; return this; }
/** * Given the primitive type, returns the VM default value for that type in a boxed form. * @return null unless {@link Class#isPrimitive} */ public static @CheckForNull Object getVmDefaultValueForPrimitiveType(Class<?> type) { return defaultPrimitiveValue.get(type); }
/** * Ask the extension whether it vetoes killing of the given process * * @param p The process that is about to be killed * @return a {@link VetoCause} if the process should <em>not</em> be killed, * null else. */ @CheckForNull public abstract VetoCause vetoProcessKilling(@Nonnull IOSProcess p); }
/** * Returns the executor of the current thread or null if current thread is not an executor. */ public static @CheckForNull Executor currentExecutor() { Thread t = Thread.currentThread(); if (t instanceof Executor) return (Executor) t; return IMPERSONATION.get(); }
public FingerprintParams(@CheckForNull Run build, @Nonnull String fileName) { this.build = build; this.fileName = fileName; assert fileName!=null; } }
public UserCause(@CheckForNull User user, @CheckForNull String message) { this( user != null ? user.getId() : null, message != null ? " : " + message : "" ); }
/** * Constructs a single build reference. * @param <R> the type of thing (generally {@link Run}) * @param referent the thing to load * @return a reference, or null to consult the next factory */ @CheckForNull <R> Holder<R> make(@Nonnull R referent);
/** * Finds a descriptor from a collection by the class name of the {@link Descriptor}. * This is useless as of the introduction of {@link #getId} and so only very old compatibility code needs it. */ private static @CheckForNull <T extends Descriptor> T findByClassName(Collection<? extends T> list, String className) { for (T d : list) { if(d.getClass().getName().equals(className)) return d; } return null; }
/** * Allows this wrapper to decorate log output. * @param build as is passed to {@link #setUp(Context, Run, FilePath, Launcher, TaskListener, EnvVars)} * @return a filter which ignores its {@code build} parameter and is {@link Serializable}; or null (the default) * @since 1.608 */ public @CheckForNull ConsoleLogFilter createLoggerDecorator(@Nonnull Run<?,?> build) { return null; }
/** * Convert empty string to null, and trim whitespace. * * @since 1.154 */ @CheckForNull public static String fixEmptyAndTrim(@CheckForNull String s) { if(s==null) return null; return fixEmpty(s.trim()); }
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; }
public static void staticOneArgCheckForNullCorrectlyDoesNotThrowNPE( @javax.annotation.CheckForNull String s) { // null? no problem }
/** * @deprecated as of 1.421 * Use {@link #Permission(PermissionGroup, String, Localizable, Permission, PermissionScope)} */ @Deprecated public Permission(@Nonnull PermissionGroup group, @Nonnull String name, @CheckForNull Localizable description, @CheckForNull Permission impliedBy) { this(group, name, description, impliedBy, PermissionScope.JENKINS); }