org.jooby.Request.params()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(442)

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

Request.params介绍

[英]Short version of params().to(type).
[中][$0$]的短版本。

代码示例

代码示例来源:origin: jooby-project/jooby

@Override
public Mutant params(final String... xss) {
 return req.params(xss);
}

代码示例来源:origin: jooby-project/jooby

@Override
public <T> T params(final Class<T> type, final String... xss) {
 return req.params(type, xss);
}

代码示例来源:origin: jooby-project/jooby

@Override
public <T> T params(final Class<T> type) {
 return req.params(type);
}

代码示例来源:origin: jooby-project/jooby

@Override
public Mutant params() {
 return req.params();
}

代码示例来源:origin: jooby-project/jooby

/**
 * Short version of <code>params().to(type)</code>.
 *
 * @param type Object type.
 * @param <T> Value type.
 * @return Instance of object.
 */
@Nonnull
default <T> T params(final Class<T> type) {
 return params().to(type);
}

代码示例来源:origin: jooby-project/jooby

/**
 * Short version of <code>params(xss).to(type)</code>.
 *
 * @param type Object type.
 * @param xss Xss filter to apply.
 * @param <T> Value type.
 * @return Instance of object.
 */
@Nonnull
default <T> T params(final Class<T> type, final String... xss) {
 return params(xss).to(type);
}

代码示例来源:origin: jooby-project/jooby

/**
 * Short version of <code>params(xss).to(type)</code>.
 *
 * @param type Object type.
 * @param xss Xss filter to apply.
 * @param <T> Value type.
 * @return Instance of object.
 */
@Nonnull
default <T> T form(final Class<T> type, final String... xss) {
 return params(xss).to(type);
}

代码示例来源:origin: jooby-project/jooby

/**
 * Short version of <code>params().to(type)</code>.
 *
 * @param type Object type.
 * @param <T> Value type.
 * @return Instance of object.
 */
@Nonnull
default <T> T form(final Class<T> type) {
 return params().to(type);
}

代码示例来源:origin: jooby-project/jooby

private Map<String, String[]> params(final Request req) {
 ImmutableMap.Builder<String, String[]> result = ImmutableMap.<String, String[]>builder();
 req.params().toMap().forEach((name, value) -> {
  try {
   List<String> values = value.toList();
   result.put(name, values.toArray(new String[values.size()]));
  } catch (Err ignored) {
   log.debug("ignoring HTTP param: " + name, ignored);
  }
 });
 return result.build();
}

代码示例来源:origin: jooby-project/jooby

private static Map<String, String[]> params(final Request req) {
  ImmutableMap.Builder<String, String[]> result = ImmutableMap.<String, String[]>builder();

  req.params().toMap().forEach((name, value) -> {
   try {
    List<String> values = value.toList();
    result.put(name, values.toArray(new String[values.size()]));
   } catch (Err ignored) {
    LoggerFactory.getLogger(Pac4jContext.class).debug("ignoring HTTP param: " + name, ignored);
   }
  });
  return result.build();
 }
}

代码示例来源:origin: jooby-project/jooby

}));
envdata.put("request params", dump(() -> req.params().toMap()));

代码示例来源:origin: jooby-project/jooby

private static final GetValue param() {
  return (req, rsp, chain, param) -> {
   Mutant mutant = req.param(param.name);
   if (mutant.isSet() || param.optional) {
    return mutant.to(param.type);
   }
   try {
    return req.params().to(param.type);
   } catch (Err ex) {
    // force parsing
    return mutant.to(param.type);
   }
  };
 }
}

代码示例来源:origin: org.jooby/jooby

@Override
public Mutant params() {
 return req.params();
}

代码示例来源:origin: org.jooby/jooby

@Override
public Mutant params(final String... xss) {
 return req.params(xss);
}

代码示例来源:origin: org.jooby/jooby

@Override
public <T> T params(final Class<T> type, final String... xss) {
 return req.params(type, xss);
}

代码示例来源:origin: org.jooby/jooby

/**
 * Short version of <code>params().to(type)</code>.
 *
 * @param type Object type.
 * @param <T> Value type.
 * @return Instance of object.
 */
@Nonnull
default <T> T form(final Class<T> type) {
 return params().to(type);
}

代码示例来源:origin: org.jooby/jooby

/**
 * Short version of <code>params(xss).to(type)</code>.
 *
 * @param type Object type.
 * @param xss Xss filter to apply.
 * @param <T> Value type.
 * @return Instance of object.
 */
@Nonnull
default <T> T params(final Class<T> type, final String... xss) {
 return params(xss).to(type);
}

代码示例来源:origin: org.jooby/jooby

/**
 * Short version of <code>params(xss).to(type)</code>.
 *
 * @param type Object type.
 * @param xss Xss filter to apply.
 * @param <T> Value type.
 * @return Instance of object.
 */
@Nonnull
default <T> T form(final Class<T> type, final String... xss) {
 return params(xss).to(type);
}

代码示例来源:origin: org.jooby/jooby

/**
 * Short version of <code>params().to(type)</code>.
 *
 * @param type Object type.
 * @param <T> Value type.
 * @return Instance of object.
 */
@Nonnull
default <T> T params(final Class<T> type) {
 return params().to(type);
}

代码示例来源:origin: org.jooby/jooby-pac4j

private Map<String, String[]> params(final Request req) {
 ImmutableMap.Builder<String, String[]> result = ImmutableMap.<String, String[]>builder();
 req.params().toMap().forEach((name, value) -> {
  try {
   List<String> values = value.toList();
   result.put(name, values.toArray(new String[values.size()]));
  } catch (Err ignored) {
   log.debug("ignoring HTTP param: " + name, ignored);
  }
 });
 return result.build();
}

相关文章