本文整理了Java中org.vertx.java.core.json.JsonObject.getNumber()
方法的一些代码示例,展示了JsonObject.getNumber()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonObject.getNumber()
方法的具体详情如下:
包路径:org.vertx.java.core.json.JsonObject
类名称:JsonObject
方法名:getNumber
暂无
代码示例来源:origin: org.vert-x/vertx-core
public Number getNumber(String fieldName, int def) {
Number n = getNumber(fieldName);
return n == null ? def : n;
}
代码示例来源:origin: org.vert-x/vertx-platform
protected int getMandatoryIntConfig(String fieldName) {
Integer i = (Integer)config.getNumber(fieldName);
if (i == null) {
throw new IllegalArgumentException(fieldName + " must be specified in config for busmod");
}
return i;
}
代码示例来源:origin: org.vert-x/vertx-platform
protected long getMandatoryLongConfig(String fieldName) {
Long l = (Long)config.getNumber(fieldName);
if (l == null) {
throw new IllegalArgumentException(fieldName + " must be specified in config for busmod");
}
return l;
}
代码示例来源:origin: org.vert-x/vertx-platform
protected int getOptionalIntConfig(String fieldName, int defaultValue) {
Integer b = (Integer)config.getNumber(fieldName);
return b == null ? defaultValue : b.intValue();
}
代码示例来源:origin: io.vertx/vertx-platform
protected int getOptionalIntConfig(String fieldName, int defaultValue) {
Number i = config.getNumber(fieldName);
return i == null ? defaultValue : i.intValue();
}
代码示例来源:origin: io.vertx/vertx-platform
protected long getOptionalLongConfig(String fieldName, long defaultValue) {
Number l = config.getNumber(fieldName);
return l == null ? defaultValue : l.longValue();
}
代码示例来源:origin: org.vert-x/vertx-platform
protected long getOptionalLongConfig(String fieldName, long defaultValue) {
Long l = (Long)config.getNumber(fieldName);
return l == null ? defaultValue : l.longValue();
}
代码示例来源:origin: io.vertx/vertx-platform
protected int getMandatoryIntConfig(String fieldName) {
Number i = config.getNumber(fieldName);
if (i == null) {
throw new IllegalArgumentException(fieldName + " must be specified in config for busmod");
}
return i.intValue();
}
代码示例来源:origin: io.vertx/vertx-platform
protected long getMandatoryLongConfig(String fieldName) {
Number l = config.getNumber(fieldName);
if (l == null) {
throw new IllegalArgumentException(fieldName + " must be specified in config for busmod");
}
return l.longValue();
}
代码示例来源:origin: com.englishtown/vertx-mod-jersey
/**
* The max body size in bytes when reading the vert.x input stream
*
* @return the max body size bytes
*/
@Override
public int getMaxBodySize() {
checkState();
return config.getNumber(CONFIG_MAX_BODY_SIZE, DEFAULT_MAX_BODY_SIZE).intValue();
}
代码示例来源:origin: org.vert-x/vertx-core
private JsonObject setDefaults(JsonObject config) {
config = config.copy();
//Set the defaults
if (config.getNumber("session_timeout") == null) {
config.putNumber("session_timeout", 5 * 1000); // 5 seconds default
}
if (config.getBoolean("insert_JSESSIONID") == null) {
config.putBoolean("insert_JSESSIONID", true);
}
if (config.getNumber("heartbeat_period") == null) {
config.putNumber("heartbeat_period", 5l * 1000);
}
if (config.getNumber("max_bytes_streaming") == null) {
config.putNumber("max_bytes_streaming", 128 * 1024);
}
if (config.getString("prefix") == null) {
config.putString("prefix", "/");
}
if (config.getString("library_url") == null) {
config.putString("library_url", "http://cdn.sockjs.org/sockjs-0.2.1.min.js");
}
if (config.getArray("disabled_transports") == null) {
config.putArray("disabled_transports", new JsonArray());
}
return config;
}
内容来源于网络,如有侵权,请联系作者删除!