private static Set<String> listToSet(final BsonArray array) { if (array == null || array.isEmpty()) { return Collections.emptySet(); } else { Set<String> set = new HashSet<String>(); for (BsonValue value : array) { set.add(value.asString().getValue()); } return set; } }
@Override public Boolean apply(final BsonDocument result, final ServerAddress serverAddress) { return result.get("users").isArray() && !result.getArray("users").isEmpty(); } };
if (keyvalueforStruct.getValue().asArray().isEmpty()) { switch (arrayEncoding) { case ARRAY:
if (keyValuesforSchema.getValue().asArray().isEmpty()) { switch (arrayEncoding) { case ARRAY:
private static Set<String> listToSet(final BsonArray array) { if (array == null || array.isEmpty()) { return Collections.emptySet(); } else { Set<String> set = new HashSet<String>(); for (BsonValue value : array) { set.add(value.asString().getValue()); } return set; } }
@Override public Boolean apply(final BsonDocument result, final ServerAddress serverAddress) { return result.get("users").isArray() && !result.getArray("users").isEmpty(); } };
if (ret.isEmpty()) { return null; } else {
public static ArrayValue translateArray(BsonArray array) { ArrayValue.Builder builder = new ArrayValue.Builder(); for (BsonValue object : array) { builder.add(translateBSON(object)); } if (array.isEmpty()) { builder.setElementType(GenericType.INSTANCE); } return builder.build(); }
ArrayList<Optional<BsonValue>> ret = new ArrayList<>(); if (!json.asArray().isEmpty()) { for (int index = 0; index < json.asArray().size(); index++) { nested = _getPropsFromPath(
addItems(_warnings, embedded, "rh:warnings"); if (!_warnings.isEmpty()) { responseContent.append("_warnings", _warnings); addItems(_errors, embedded, "rh:error"); if (!_errors.isEmpty()) { responseContent.append("_errors", _errors); addItems(_exception, embedded, "rh:exception"); if (!_exception.isEmpty()) { responseContent.append("_exceptions", _exception);