azkaban.utils.Utils.nonNull()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(178)

本文整理了Java中azkaban.utils.Utils.nonNull()方法的一些代码示例,展示了Utils.nonNull()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.nonNull()方法的具体详情如下:
包路径:azkaban.utils.Utils
类名称:Utils
方法名:nonNull

Utils.nonNull介绍

[英]Return the object if it is non-null, otherwise throw an exception
[中]如果对象非空,则返回该对象,否则引发异常

代码示例

代码示例来源:origin: azkaban/azkaban

/**
 * Creates a page and sets up the velocity engine to render
 */
public Page(final HttpServletRequest request, final HttpServletResponse response,
  final VelocityEngine engine, final String template) {
 this.request = Utils.nonNull(request);
 this.response = Utils.nonNull(response);
 this.engine = Utils.nonNull(engine);
 this.template = Utils.nonNull(template);
 this.context = new VelocityContext();
 this.context.put("esc", new EscapeTool());
 this.context.put("session", request.getSession(true));
 this.context.put("context", request.getContextPath());
}

代码示例来源:origin: com.linkedin.azkaban/azkaban

/**
 * Creates a page and sets up the velocity engine to render
 * 
 * @param request
 * @param response
 * @param engine
 * @param template
 */
public Page(HttpServletRequest request, HttpServletResponse response,
    VelocityEngine engine, String template) {
  this.request = Utils.nonNull(request);
  this.response = Utils.nonNull(response);
  this.engine = Utils.nonNull(engine);
  this.template = Utils.nonNull(template);
  this.context = new VelocityContext();
  this.context.put("session", request.getSession(true));
  this.context.put("context", request.getContextPath());
}

相关文章