break; case BOOL: token = value.isTrue() ? JsonToken.VALUE_TRUE : JsonToken.VALUE_FALSE; break; case DOUBLE:
public boolean getAsBoolean() { if (!isBoolean()) { throw new VPackValueTypeException(ValueType.BOOL); } return isTrue(); }
@SuppressWarnings("unchecked") @Override public MultiDocumentEntity<T> deserialize(final Response response) throws VPackException { final MultiDocumentEntity<T> multiDocument = new MultiDocumentEntity<T>(); final Collection<T> docs = new ArrayList<T>(); final Collection<ErrorEntity> errors = new ArrayList<ErrorEntity>(); final Collection<Object> documentsAndErrors = new ArrayList<Object>(); final VPackSlice body = response.getBody(); for (final Iterator<VPackSlice> iterator = body.arrayIterator(); iterator.hasNext();) { final VPackSlice next = iterator.next(); if (next.get(ArangoResponseField.ERROR).isTrue()) { final ErrorEntity error = (ErrorEntity) util().deserialize(next, ErrorEntity.class); errors.add(error); documentsAndErrors.add(error); } else { final T doc = (T) util(Serializer.CUSTOM).deserialize(next, type); docs.add(doc); documentsAndErrors.add(doc); } } multiDocument.setDocuments(docs); multiDocument.setErrors(errors); multiDocument.setDocumentsAndErrors(documentsAndErrors); return multiDocument; } };
for (final Iterator<VPackSlice> iterator = body.arrayIterator(); iterator.hasNext();) { final VPackSlice next = iterator.next(); if (next.get(ArangoResponseField.ERROR).isTrue()) { final ErrorEntity error = (ErrorEntity) util().deserialize(next, ErrorEntity.class); errors.add(error);
for (final Iterator<VPackSlice> iterator = body.arrayIterator(); iterator.hasNext();) { final VPackSlice next = iterator.next(); if (next.get(ArangoResponseField.ERROR).isTrue()) { final ErrorEntity error = (ErrorEntity) util().deserialize(next, ErrorEntity.class); errors.add(error);
for (final Iterator<VPackSlice> iterator = body.arrayIterator(); iterator.hasNext();) { final VPackSlice next = iterator.next(); if (next.get(ArangoResponseField.ERROR).isTrue()) { final ErrorEntity error = (ErrorEntity) util().deserialize(next, ErrorEntity.class); errors.add(error);
for (final Iterator<VPackSlice> iterator = body.arrayIterator(); iterator.hasNext();) { final VPackSlice next = iterator.next(); if (next.get(ArangoResponseField.ERROR).isTrue()) { final ErrorEntity error = (ErrorEntity) util().deserialize(next, ErrorEntity.class); errors.add(error);