本文整理匯總了Java中io.vertx.core.json.JsonObject.mergeIn方法的典型用法代碼示例。如果您正苦於以下問題:Java JsonObject.mergeIn方法的具體用法?Java JsonObject.mergeIn怎麽用?Java JsonObject.mergeIn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類io.vertx.core.json.JsonObject
的用法示例。
在下文中一共展示了JsonObject.mergeIn方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initOpts
import io.vertx.core.json.JsonObject; //導入方法依賴的package包/類
private void initOpts(final JsonObject raw) {
// Options
JsonObject normalized = getOptions();
if (raw.containsKey("timeout")) {
final JsonObject options = raw.getJsonObject("timeout");
normalized = normalized.mergeIn(options);
}
this.options = new Request.Options(
normalized.getInteger("connect"),
normalized.getInteger("read"));
// Defaults
normalized = getDefaults();
if (raw.containsKey("retry")) {
final JsonObject defaults = raw.getJsonObject("retry");
normalized = normalized.mergeIn(defaults);
}
this.defaults = new Retryer.Default(
normalized.getInteger("period"),
normalized.getInteger("maxPeriod"),
normalized.getInteger("attempts")
);
}
示例2: ingest
import io.vertx.core.json.JsonObject; //導入方法依賴的package包/類
@Override
public JsonObject ingest(final String key)
throws ZeroException {
final Node<JsonObject> node =
Fn.pool(EXTENSIONS, key,
() -> Node.infix(key));
final JsonObject data = new JsonObject();
try {
data.mergeIn(node.read());
} catch (final EmptyStreamException ex) {
if (data.isEmpty()) {
throw new LimeFileException(ZeroTool.produce(key));
}
}
return data;
}
示例3: read
import io.vertx.core.json.JsonObject; //導入方法依賴的package包/類
static JsonObject read(final String key, final boolean extension) {
/** Read the original configuration **/
final JsonObject original = readDirect(produce(key));
final JsonObject merged = new JsonObject();
if (extension) {
/** Read the internal configuration instead **/
final JsonObject internal = readDirect("ke/config/" + produce(key));
if (null != internal) {
merged.mergeIn(internal, true);
}
}
if (null != original) {
merged.mergeIn(original, true);
}
return merged;
}
示例4: retrieve
import io.vertx.core.json.JsonObject; //導入方法依賴的package包/類
@Override
protected OAuth2Auth retrieve() {
JsonObject authConfig = record().getMetadata().copy().mergeIn(record().getLocation());
if (config != null) {
authConfig.mergeIn(config);
}
OAuth2FlowType flow = OAuth2FlowType.valueOf(authConfig.getString("flow.type", "AUTH_CODE").toUpperCase());
if (authConfig.getBoolean("type.keycloak")) {
return OAuth2Auth.createKeycloak(vertx, flow, authConfig);
} else {
return OAuth2Auth.create(vertx, flow, new OAuth2ClientOptions(authConfig));
}
}
示例5: termIn
import io.vertx.core.json.JsonObject; //導入方法依賴的package包/類
static JsonObject termIn(final JsonObject filter, final String field, final JsonArray values) {
final JsonObject terms = new JsonObject();
if (null != filter) {
terms.mergeIn(filter);
}
return terms.put(field, new JsonObject().put("$in", values));
}
示例6: termLike
import io.vertx.core.json.JsonObject; //導入方法依賴的package包/類
static JsonObject termLike(final JsonObject filter, final String field, final String value) {
final JsonObject terms = new JsonObject();
if (null != filter) {
terms.mergeIn(filter);
}
return terms.put(field, new JsonObject().put("$regex", ".*" + value + ".*"));
}