org.eclipse.ditto.json.JsonObject.setAll()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(89)

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

JsonObject.setAll介绍

[英]Creates a new JSON object by setting the given JSON fields to this object. All previous fields with the same key are replaced.
[中]通过将给定的JSON字段设置为此对象来创建新的JSON对象。替换具有相同键的所有先前字段。

代码示例

代码示例来源:origin: eclipse/ditto

@Override
public FeatureProperties setAll(final Iterable<JsonField> jsonFields) {
  return determineResult(() -> wrapped.setAll(jsonFields));
}

代码示例来源:origin: org.eclipse.ditto/ditto-model-things

@Override
public FeatureProperties setAll(final Iterable<JsonField> jsonFields) {
  return determineResult(() -> wrapped.setAll(jsonFields));
}

代码示例来源:origin: org.eclipse.ditto/ditto-model-things

@Override
public Attributes setAll(final Iterable<JsonField> jsonFields) {
  return determineResult(() -> wrapped.setAll(jsonFields));
}

代码示例来源:origin: eclipse/ditto

@Override
public Attributes setAll(final Iterable<JsonField> jsonFields) {
  return determineResult(() -> wrapped.setAll(jsonFields));
}

代码示例来源:origin: eclipse/ditto

/**
 * A "payload" object was wrapping the events payload until the introduction of "cr-commands 1.0.0".
 * This field has to be used as fallback for already persisted events with "things-model" < 3.0.0.
 * Removing this workaround is possible if we are sure that no "old" events are ever loaded again!
 */
private JsonObject migratePayload(final JsonObject jsonObject) {
  return jsonObject.getValue(PAYLOAD)
      .filter(JsonValue::isObject)
      .map(JsonValue::asObject)
      .map(obj -> jsonObject.remove(PAYLOAD.getPointer()).setAll(obj))
      .orElse(jsonObject);
}

代码示例来源:origin: org.eclipse.ditto/ditto-services-things-persistence

/**
 * A "payload" object was wrapping the events payload until the introduction of "cr-commands 1.0.0".
 * This field has to be used as fallback for already persisted events with "things-model" < 3.0.0.
 * Removing this workaround is possible if we are sure that no "old" events are ever loaded again!
 */
private JsonObject migratePayload(final JsonObject jsonObject) {
  return jsonObject.getValue(PAYLOAD)
      .filter(JsonValue::isObject)
      .map(JsonValue::asObject)
      .map(obj -> jsonObject.remove(PAYLOAD.getPointer()).setAll(obj))
      .orElse(jsonObject);
}

代码示例来源:origin: eclipse/ditto

/**
 * A "payload" object was wrapping the events payload until the introduction of "cr-commands 1.0.0". This field has
 * to be used as fallback for already persisted events with "things-model" < 3.0.0. Removing this workaround is
 * possible if we are sure that no "old" events are ever loaded again!
 */
private static JsonObject migratePayload(final JsonObject jsonObject) {
  return jsonObject.getValue(PAYLOAD)
      .map(obj -> jsonObject.remove(PAYLOAD.getPointer()).setAll(obj))
      .orElse(jsonObject);
}

代码示例来源:origin: org.eclipse.ditto/ditto-services-policies-persistence

/**
 * A "payload" object was wrapping the events payload until the introduction of "cr-commands 1.0.0". This field has
 * to be used as fallback for already persisted events with "things-model" < 3.0.0. Removing this workaround is
 * possible if we are sure that no "old" events are ever loaded again!
 */
private static JsonObject migratePayload(final JsonObject jsonObject) {
  return jsonObject.getValue(PAYLOAD)
      .map(obj -> jsonObject.remove(PAYLOAD.getPointer()).setAll(obj))
      .orElse(jsonObject);
}

代码示例来源:origin: org.eclipse.ditto/ditto-model-things

@Override
public Attributes setAll(final Iterable<JsonField> jsonFields) {
  return ImmutableAttributes.of(JsonFactory.newObject().setAll(jsonFields));
}

代码示例来源:origin: eclipse/ditto

@Override
public Attributes setAll(final Iterable<JsonField> jsonFields) {
  return ImmutableAttributes.of(JsonFactory.newObject().setAll(jsonFields));
}

相关文章