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

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

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

JsonObject.isEmpty介绍

暂无

代码示例

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

@Override
public boolean isEmpty() {
  return wrapped.isEmpty();
}

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

@Override
public boolean isEmpty() {
  return wrapped.isEmpty();
}

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

@Override
public boolean isEmpty() {
  return wrapped.isEmpty();
}

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

@Override
public boolean isEmpty() {
  return wrapped.isEmpty();
}

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

private static List<PointerAndValue> collectFlatPointers(final JsonPointer createdPointer, final JsonField field,
    final List<PointerAndValue> flattenedFields) {
  final JsonValue fieldValue = field.getValue();
  if (fieldValue.isObject()) {
    final JsonObject jsonObject = fieldValue.asObject();
    if (!jsonObject.isEmpty()) {
      jsonObject.forEach(jsonField -> collectFlatPointers(createdPointer.addLeaf(jsonField.getKey()),
          jsonField, flattenedFields));
    } else {
      flattenedFields.add(new PointerAndValue(createdPointer, fieldValue));
    }
  } else {
    flattenedFields.add(new PointerAndValue(createdPointer, fieldValue));
  }
  return flattenedFields;
}

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

@Override
public FromScratch setAttributes(final JsonObject attributesJsonObject) {
  checkNotNull(attributesJsonObject, "JSON object representation of Attributes to be set");
  if (attributesJsonObject.isNull()) {
    return setNullAttributes();
  } else if (attributesJsonObject.isEmpty()) {
    return setEmptyAttributes();
  }
  return setAttributes(ThingsModelFactory.newAttributes(attributesJsonObject));
}

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

@Override
public FromScratch setAttributes(final JsonObject attributesJsonObject) {
  checkNotNull(attributesJsonObject, "JSON object representation of Attributes to be set");
  if (attributesJsonObject.isNull()) {
    return setNullAttributes();
  } else if (attributesJsonObject.isEmpty()) {
    return setEmptyAttributes();
  }
  return setAttributes(ThingsModelFactory.newAttributes(attributesJsonObject));
}

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

.filter(thingJson -> !thingJson.isEmpty()) // avoid sending back empty jsonValues
.map(jsonValue -> ServerSentEvent.create(jsonValue.toString()))
.keepAlive(Duration.ofSeconds(1), ServerSentEvent::heartbeat);

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

private static void validate(final CharSequence jsonKey, final JsonValue jsonValue) {
  checkNotNull(jsonKey, "JSON key");
  checkNotNull(jsonValue, "JSON value");
  final String msgTemplate =
      "Expected for Authorization Subject ''{0}'' a JSON object containing all of {1}" + " but got <{2}>!";
  final Supplier<String> descriptionSupplier =
      () -> MessageFormat.format(msgTemplate, jsonKey, Permission.allToString(), jsonValue);
  if (!jsonValue.isObject()) {
    throw new DittoJsonException(JsonParseException.newBuilder() //
        .description(descriptionSupplier) //
        .build());
  }
  final JsonObject permissionsJsonObject = jsonValue.asObject();
  if (permissionsJsonObject.isEmpty()) {
    throw AclEntryInvalidException.newBuilder() //
        .description(descriptionSupplier) //
        .build();
  }
}

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

private static void validate(final CharSequence jsonKey, final JsonValue jsonValue) {
  checkNotNull(jsonKey, "JSON key");
  checkNotNull(jsonValue, "JSON value");
  final String msgTemplate =
      "Expected for Authorization Subject ''{0}'' a JSON object containing all of {1}" + " but got <{2}>!";
  final Supplier<String> descriptionSupplier =
      () -> MessageFormat.format(msgTemplate, jsonKey, Permission.allToString(), jsonValue);
  if (!jsonValue.isObject()) {
    throw new DittoJsonException(JsonParseException.newBuilder() //
        .description(descriptionSupplier) //
        .build());
  }
  final JsonObject permissionsJsonObject = jsonValue.asObject();
  if (permissionsJsonObject.isEmpty()) {
    throw AclEntryInvalidException.newBuilder() //
        .description(descriptionSupplier) //
        .build();
  }
}

相关文章