/** * Trim leading whitespace from the given String. * * @param str the string to check * @return the trimmed String * @see java.lang.Character#isWhitespace(char) */ public static String trimLeadingWhitespace(String str) { return trimLeadingCharacter(str, CharacterFilter.WHITESPACE); }
/** * Split up a string into multiple strings based on a delimiter. * * @param string String to split up. * @param delim Delimiter. * @return Array of strings. */ public static String[] split(final String string, final String delim) { return split(string, delim, -1); }
/** * Construct a new {@link AbstractRulesetMetadata} instance using the given {@link String} ID. */ public AbstractRulesetMetadata(String id) { Assert.notNull(id, "Ruleset ID must not be null."); this.id = id; }
public static String firstNotBlank(String... texts) { for (String text : texts) { if (!Strings.isNullOrEmpty(text)) { return text; } } return null; }
@Override public boolean accept(RuleProvider provider) { return !this.predicate.accept(provider); } }
/** * Convert and join an array of objects into one string. * * @param array Array of objects to join as strings. * @return Converted and joined objects. */ public static String join(final Object array[]) { return join(array, null); }
/** * Wrap a constant value into a {@link Callable} instance. */ public static <T> Callable<T> returning(T value) { return new ConstantCallable<>(value); }
/** * Return <code>true</code> if the {@link #getResult()} is not <code>null</code>. */ public boolean hasResult() { return getResult() != null; } }
private StackBuilder(String name) { Assert.notNull(name, "Name cannot be null"); this.name = name; }
public RestWebXmlConfigurationStrategy(String path) { Assert.notNull(path, "Path cannot be null"); this.path = path; }
public URLResourceImpl(ResourceFactory factory, URL resource) { super(factory, null); Assert.notNull(resource, "URL resource cannot be null"); this.resource = resource; }
protected AbstractFacetEvent(Facet<?> facet) { Assert.notNull(facet, "Facet should not be null"); this.facet = facet; }
protected AbstractAddonActionRequest(AddonInfo addonInfo, MutableAddonRepository addonRepository, Furnace furnace) { Assert.notNull(addonInfo, "AddonInfo must not be null."); Assert.notNull(furnace, "Addon Repository must not be null."); Assert.notNull(furnace, "Furnace must not be null."); this.addonInfo = addonInfo; this.furnace = furnace; this.repository = addonRepository; }
public FileResourceModelSource(FileResource<?> fileResource) { Assert.notNull(fileResource, "POM Resource may not be null"); this.fileResource = fileResource; }
public URLArchetypeCatalogFactory(String name, URL catalogURL, String defaultRepository) { super(); Assert.notNull(name, "Name should not be null"); Assert.notNull(catalogURL, "Catalog URL must be specified"); this.name = name; this.catalogURL = catalogURL; this.defaultRepository = defaultRepository; }
/** * Create an instance for the provided rule. */ public RuleExecutionInformation(Rule rule) { Assert.notNull(rule, "Rule object must not be null"); this.rule = rule; }
public PostStartup(Addon addon) { Assert.notNull(addon, "Addon must not be null."); this.addon = addon; }
public PreShutdown(Addon addon) { Assert.notNull(addon, "Addon must not be null."); this.addon = addon; }
/** * Construct a new {@link AbstractRulesetMetadata} instance using the given {@link String} ID. */ public AbstractRulesetMetadata(String id) { Assert.notNull(id, "Ruleset ID must not be null."); this.id = id; }