Tabnine Logo
Dew$E
Code IndexAdd Tabnine to your IDE (free)

How to use
Dew$E
in
com.tairanchina.csp.dew

Best Java code snippets using com.tairanchina.csp.dew.Dew$E (Showing top 10 results out of 315)

origin: gudaoxuri/dew

throw Dew.E.e(StandardCode.BAD_REQUEST.toString(), new RuntimeException("Entity List is empty."));
  throw Dew.E.e(StandardCode.BAD_REQUEST.toString(), new RuntimeException("Not Null check fail."));
origin: gudaoxuri/dew

public static <E extends RuntimeException> void checkNotEmpty(Map<?, ?> objects, E ex) {
  check(() -> objects == null || objects.size() == 0, ex);
}
origin: gudaoxuri/dew

throw Dew.E.e(StandardCode.NOT_FOUND.toString(), new RuntimeException("Need @PkColumn or @CodeColumn field."));
  values.remove(entityClassInfo.codeFieldNameOpt.get());
} else {
  throw Dew.E.e(StandardCode.BAD_REQUEST.toString(), new RuntimeException("Need Private Key or Code value."));
throw Dew.E.e(StandardCode.BAD_REQUEST.toString(), new RuntimeException("Not Null check fail."));
origin: gudaoxuri/dew

public static <E extends RuntimeException> void checkNotEmpty(Iterable<?> objects, E ex) {
  check(() -> objects == null || !objects.iterator().hasNext(), ex);
}
origin: gudaoxuri/dew

public static <E extends RuntimeException> void checkNotNull(Object obj, E ex) {
  check(() -> obj == null, ex);
}
origin: gudaoxuri/dew

/**
 * 异常处理-重用Http状态
 *
 * @param code           异常编码
 * @param ex             异常类型
 * @param customHttpCode 自定义Http状态码
 */
public static <E extends Throwable> E e(String code, E ex, StandardCode customHttpCode) {
  return e(code, ex, Integer.valueOf(customHttpCode.toString()));
}
origin: gudaoxuri/dew

/**
 * 抛出不符合预期异常
 *
 * @param notExpected 不符合预期的情况
 */
public static void check(boolean notExpected) {
  check(() -> notExpected);
}
origin: gudaoxuri/dew

@PutMapping("offline")
public String generateOfflineDoc(@Validated @RequestBody OfflineDocGenerateReq request) throws Exception {
  List<String> swaggerJsonUrls =
      (request.getSwaggerJsonUrls() == null || request.getSwaggerJsonUrls().isEmpty()) ?
          fetchSwaggerJsonUrlsFun.get() : request.getSwaggerJsonUrls();
  Resp<String> result = docService.generateOfflineDoc(request.getDocName(), request.getDocDesc(), request.getVisitUrls(), swaggerJsonUrls);
  if (result.ok()) {
    return result.getBody();
  } else {
    throw Dew.E.e(result.getCode(), new Exception(result.getMessage()));
  }
}
origin: gudaoxuri/dew

/**
 * 抛出不符合预期异常
 *
 * @param notExpected 不符合预期的情况
 * @param ex          异常
 */
public static <E extends RuntimeException> void check(boolean notExpected, E ex) {
  check(() -> notExpected, ex);
}
origin: gudaoxuri/dew

/**
 * 异常处理-重用Http状态
 *
 * @param code 异常编码
 * @param ex   异常类型
 */
public static <E extends Throwable> E e(String code, E ex) {
  return e(code, ex, -1);
}
com.tairanchina.csp.dewDew$E

Most used methods

  • e
    异常处理-重用Http状态
  • check
    抛出不符合预期异常

Popular in Java

  • Updating database using SQL prepared statement
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • requestLocationUpdates (LocationManager)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • String (java.lang)
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JTable (javax.swing)
  • Best IntelliJ plugins
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