本文整理了Java中org.eclipse.ditto.json.JsonObject.isEmpty()
方法的一些代码示例,展示了JsonObject.isEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JsonObject.isEmpty()
方法的具体详情如下:
包路径:org.eclipse.ditto.json.JsonObject
类名称: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();
}
}
内容来源于网络,如有侵权,请联系作者删除!