Tabnine Logo
StringUtils.isNullOrEmpty
Code IndexAdd Tabnine to your IDE (free)

How to use
isNullOrEmpty
method
in
ro.pippo.core.util.StringUtils

Best Java code snippets using ro.pippo.core.util.StringUtils.isNullOrEmpty (Showing top 20 results out of 315)

origin: pippo-java/pippo

protected boolean acceptsGZipEncoding(HttpServletRequest httpServletRequest) {
  String acceptEncoding = httpServletRequest.getHeader("accept-encoding");
  return !StringUtils.isNullOrEmpty(acceptEncoding) && (
    acceptEncoding.contains("gzip") || acceptEncoding.contains("*")
  );
}
origin: pippo-java/pippo

protected boolean acceptsGZipEncoding(HttpServletRequest request) {
  String acceptEncoding = request.getHeader("accept-encoding");
  return !StringUtils.isNullOrEmpty(acceptEncoding) && (
    acceptEncoding.contains("gzip") || acceptEncoding.contains("*")
  );
}
origin: pippo-java/pippo

public int toInt(int defaultValue) {
  if (isNull() || StringUtils.isNullOrEmpty(values[0])) {
    return defaultValue;
  }
  return Integer.parseInt(values[0]);
}
origin: pippo-java/pippo

public short toShort(short defaultValue) {
  if (isNull() || StringUtils.isNullOrEmpty(values[0])) {
    return defaultValue;
  }
  return Short.parseShort(values[0]);
}
origin: pippo-java/pippo

public java.sql.Date toSqlDate(java.sql.Date defaultValue) {
  if (isNull() || StringUtils.isNullOrEmpty(values[0])) {
    return defaultValue;
  }
  return java.sql.Date.valueOf(values[0]);
}
origin: pippo-java/pippo

public long toLong(long defaultValue) {
  if (isNull() || StringUtils.isNullOrEmpty(values[0])) {
    return defaultValue;
  }
  return Long.parseLong(values[0]);
}
origin: pippo-java/pippo

public Time toSqlTime(Time defaultValue) {
  if (isNull() || StringUtils.isNullOrEmpty(values[0])) {
    return defaultValue;
  }
  return Time.valueOf(values[0]);
}
origin: pippo-java/pippo

private String getMetricName(Route route, Method method) {
  String metricName = route.getName();
  if (StringUtils.isNullOrEmpty(metricName)) {
    metricName = MetricRegistry.name(method.getDeclaringClass(), method.getName());
  }
  return metricName;
}
origin: pippo-java/pippo

public Timestamp toSqlTimestamp(Timestamp defaultValue) {
  if (isNull() || StringUtils.isNullOrEmpty(values[0])) {
    return defaultValue;
  }
  return Timestamp.valueOf(values[0]);
}
origin: pippo-java/pippo

public Date toDate(Date defaultValue, String pattern) {
  if (isNull() || StringUtils.isNullOrEmpty(values[0])) {
    return defaultValue;
  }
  SimpleDateFormat dateFormat = new SimpleDateFormat(pattern);
  try {
    return dateFormat.parse(values[0]);
  } catch (ParseException e) {
    throw new PippoRuntimeException(e);
  }
}
origin: pippo-java/pippo

@Override
public void setApplicationPath(String applicationPath) {
  if (StringUtils.isNullOrEmpty(applicationPath) || "/".equals(applicationPath.trim())) {
    this.applicationPath = "";
  } else {
    this.applicationPath = StringUtils.removeEnd(StringUtils.addStart(applicationPath, "/"), "/");
  }
}
origin: pippo-java/pippo

protected void validateRoute(Route route) {
  // validate the request method
  if (StringUtils.isNullOrEmpty(route.getRequestMethod())) {
    throw new PippoRuntimeException("Unspecified request method!");
  }
  // validate the uri pattern
  String uriPattern = route.getUriPattern();
  if (StringUtils.isNullOrEmpty(uriPattern)) {
    throw new PippoRuntimeException("The uri pattern cannot be null or empty");
  }
}
origin: pippo-java/pippo

public float toFloat(float defaultValue) {
  if (isNull() || StringUtils.isNullOrEmpty(values[0])) {
    return defaultValue;
  }
  try {
    Number number = getDecimalFormat().parse(values[0]);
    return number.floatValue();
  } catch (ParseException e) {
    throw new PippoRuntimeException(e, "Failed to parse '{}'", values[0]);
  }
}
origin: pippo-java/pippo

public double toDouble(double defaultValue) {
  if (isNull() || StringUtils.isNullOrEmpty(values[0])) {
    return defaultValue;
  }
  try {
    Number number = getDecimalFormat().parse(values[0]);
    return number.doubleValue();
  } catch (ParseException e) {
    throw new PippoRuntimeException(e, "Failed to parse '{}'", values[0]);
  }
}
origin: pippo-java/pippo

public BigDecimal toBigDecimal(BigDecimal defaultValue) {
  if (isNull() || StringUtils.isNullOrEmpty(values[0])) {
    return defaultValue;
  }
  DecimalFormat formatter = getDecimalFormat();
  formatter.setParseBigDecimal(true);
  try {
    return (BigDecimal) formatter.parse(values[0]);
  } catch (ParseException e) {
    throw new PippoRuntimeException(e, "Failed to parse '{}'", values[0]);
  }
}
origin: pippo-java/pippo

protected WebSocketRouter.WebSocketMatch findWebSocketRoute(String requestUri) {
  String applicationPath = getApplication().getRouter().getContextPath();
  String path = applicationPath.isEmpty() ? requestUri : requestUri.substring(applicationPath.length());
  if (StringUtils.isNullOrEmpty(path)) {
    path = "/";
  }
  return getApplication().getWebSocketRouter().match(path);
}
origin: pippo-java/pippo

@SuppressWarnings("unchecked")
protected void handleRoute(Route route) {
  if (StringUtils.isNullOrEmpty(route.getName())) {
    log.debug("Executing handler for {} '{}'", route.getRequestMethod(), route.getUriPattern());
  } else {
    log.debug("Executing '{}' for {} '{}'", route.getName(), route.getRequestMethod(), route.getUriPattern());
  }
  this.route = route;
  route.getRouteHandler().handle(this);
}
origin: pippo-java/pippo

private String getParameterName(MethodParameter parameter, Header annotation) {
  String name = annotation.value();
  if (StringUtils.isNullOrEmpty(name)) {
    name = parameter.getParameterName();
  }
  if (name == null) {
    throw new PippoRuntimeException(
      "Method '{}' parameter {} does not specify a name!",
      LangUtils.toString(parameter.getMethod()), parameter.getParameterIndex());
  }
  return name;
}
origin: pippo-java/pippo

private String getParameterName(MethodParameter parameter, Param annotation) {
  String name = annotation.value();
  if (StringUtils.isNullOrEmpty(name)) {
    name = parameter.getParameterName();
  }
  if (name == null) {
    throw new PippoRuntimeException(
      "Method '{}' parameter {} does not specify a name!",
      LangUtils.toString(parameter.getMethod()), parameter.getParameterIndex());
  }
  return name;
}
origin: pippo-java/pippo

private String getParameterName(MethodParameter parameter, Session annotation) {
  String name = annotation.value();
  if (StringUtils.isNullOrEmpty(name)) {
    name = parameter.getParameterName();
  }
  if (name == null) {
    throw new PippoRuntimeException(
      "Method '{}' parameter {} does not specify a name!",
      LangUtils.toString(parameter.getMethod()), parameter.getParameterIndex());
  }
  return name;
}
ro.pippo.core.utilStringUtilsisNullOrEmpty

Popular methods of StringUtils

  • removeStart
  • removeEnd
  • addEnd
  • addStart
  • format
  • getFileExtension
    Returns the file extension of the value without the dot or an empty string.
  • getList
  • getPrefix
    Returns the prefix of the input string from 0 to the first index of the delimiter OR it returns the

Popular in Java

  • Start an intent from android
  • getSupportFragmentManager (FragmentActivity)
  • getResourceAsStream (ClassLoader)
  • onRequestPermissionsResult (Fragment)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now