@Test public void testFromJson() { PartialUpdateExpression elem = new PartialUpdateExpressionImpl(); ArrayNode arrayNode = JsonObject.getFactory().arrayNode(); arrayNode.add(elem.toJson()); UpdateExpressionList expResult = new UpdateExpressionList(elem); UpdateExpressionList result = UpdateExpressionList.fromJson(arrayNode); assertNotNull(result.getList()); assertEquals(1, result.getList().size()); assertNotNull(result.getList().get(0)); assertEquals("The element using the constructor is different", expResult.toJson(), result.toJson()); arrayNode = JsonObject.getFactory().arrayNode(); result = UpdateExpressionList.fromJson(arrayNode); expResult = new UpdateExpressionList((PartialUpdateExpression) null); assertEquals("The element using the constructor is different", expResult.toJson(), result.toJson()); }
public static UpdateExpressionList fromJson(ArrayNode node) { ArrayList<PartialUpdateExpression> list = new ArrayList<>(node.size()); for (Iterator<JsonNode> itr = node.elements(); itr.hasNext();) { list.add(PartialUpdateExpression.fromJson((ObjectNode) itr.next())); } return new UpdateExpressionList(list); }
UpdateExpressionList extends UpdateExpression { public static UpdateExpressionList fromJson(ArrayNode node) { ArrayList<PartialUpdateExpression> list = new ArrayList<>(node.size()); for (Iterator<JsonNode> itr = node.elements(); itr.hasNext();) { list.add(PartialUpdateExpression.fromJson((ObjectNode) itr.next())); } return new UpdateExpressionList(list); } }
UpdateExpressionList extends UpdateExpression { public static UpdateExpressionList fromJson(ArrayNode node) { ArrayList<PartialUpdateExpression> list = new ArrayList<>(node.size()); for (Iterator<JsonNode> itr = node.elements(); itr.hasNext();) { list.add(PartialUpdateExpression.fromJson((ObjectNode) itr.next())); } return new UpdateExpressionList(list); } UpdateExpressionList(List<PartialUpdateExpression> l);  UpdateExpressionList(PartialUpdateExpression... l); }
UpdateExpressionList extends UpdateExpression { public static UpdateExpressionList fromJson(ArrayNode node) { ArrayList<PartialUpdateExpression> list = new ArrayList<>(node.size()); for (Iterator<JsonNode> itr = node.elements(); itr.hasNext();) { list.add(PartialUpdateExpression.fromJson((ObjectNode) itr.next())); } return new UpdateExpressionList(list); } UpdateExpressionList(List<PartialUpdateExpression> l);  UpdateExpressionList(PartialUpdateExpression... l); List<PartialUpdateExpression> getList(); @Override JsonNode toJson(); static UpdateExpressionList fromJson(ArrayNode node); }
UpdateExpressionList extends UpdateExpression { public static UpdateExpressionList fromJson(ArrayNode node) { ArrayList<PartialUpdateExpression> list = new ArrayList<>(node.size()); for (Iterator<JsonNode> itr = node.elements(); itr.hasNext();) { list.add(PartialUpdateExpression.fromJson((ObjectNode) itr.next())); } return new UpdateExpressionList(list); } UpdateExpressionList(List<PartialUpdateExpression> l);  UpdateExpressionList(PartialUpdateExpression... l); List<PartialUpdateExpression> getList(); @Override JsonNode toJson(); static UpdateExpressionList fromJson(ArrayNode node);  }