Codota Logo
Utils.requireNonEmpty
Code IndexAdd Codota to your IDE (free)

How to use
requireNonEmpty
method
in
com.hortonworks.streamline.common.util.Utils

Best Java code snippets using com.hortonworks.streamline.common.util.Utils.requireNonEmpty (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Dictionary d =
  • Codota Iconnew Hashtable()
  • Codota IconBundle bundle;bundle.getHeaders()
  • Codota Iconnew Properties()
  • Smart code suggestions by Codota
}
origin: hortonworks/streamline

public TopologyState getTopologyState(String stateName) {
  Utils.requireNonEmpty(stateName, "State name cannot be empty");
  TopologyState state = states.get(stateName);
  if (state == null) {
    throw new IllegalArgumentException("No such state " + stateName);
  }
  return state;
}
origin: hortonworks/streamline

/**
 * Generates the next name for the given name and suffix.
 * <p>
 * E.g. {@code getNextName("test-foo", "-foo") returns "test-foo2",
 *      getNextName("test-foo2", "-foo") returns "test-foo3"}
 * </p>
 * @param name the current name
 * @param suffix the suffix without the number part
 * @return the next name
 */
public static String getNextName(String name, String suffix) {
  Utils.requireNonEmpty(name, "Empty name");
  String prefix;
  String suffixWithNum;
  int num = getNumPart(name, suffix);
  if (num == -1) {
    prefix = name;
    suffixWithNum = suffix;
  } else {
    prefix = getPrefix(name, suffix);
    suffixWithNum = suffix + (num + 1);
  }
  return prefix + suffixWithNum;
}
origin: hortonworks/streamline

private void validateRole(Role role) {
  Utils.requireNonEmpty(role.getName(), "Role name");
  if (StringUtils.isNumeric(role.getName())) {
    throw new IllegalArgumentException("Role name cannot be numeric");
  }
  StorageUtils.ensureUnique(role, this::listRoles, QueryParam.params(User.NAME, role.getName()));
}
origin: hortonworks/streamline

private void validateUser(User user) {
  Utils.requireNonEmpty(user.getName(), "User name");
  StorageUtils.ensureUnique(user, this::listUsers, QueryParam.params(User.NAME, user.getName()));
}
com.hortonworks.streamline.common.utilUtilsrequireNonEmpty

Javadoc

Checks that the given string is not null or empty. Throws an IllegalArgumentException if it is.

Popular methods of Utils

  • getSchemaFromConfig
    This method takes in a schema represented as a map and returns a Schema
  • getPrefix
    Gets the prefix part a string with a given suffix part. E.g. getPrefix("test-foo", "-foo") returns "
  • createObjectFromJson
    Deserialize a json string to a java object
  • getLatestName
    Returns the latest name from a given list of names that matches the given prefix and suffix part. E.
  • getNextName
    Generates the next name for the given name and suffix. E.g. getNextName("test-foo", "-foo") returns
  • getNumPart
    Gets the number part a string with a given suffix part. E.g. getNumPart("test-foo2", "-foo") returns

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • getSystemService (Context)
  • putExtra (Intent)
  • Kernel (java.awt.image)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • InputStreamReader (java.io)
    An InputStreamReader is a bridge from byte streams to character streams: It reads bytes and decodes
  • URLConnection (java.net)
    The abstract class URLConnection is the superclass of all classes that represent a communications li
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now