List of usage examples for com.google.common.collect Iterators getLast
@Nullable public static <T> T getLast(Iterator<? extends T> iterator, @Nullable T defaultValue)
From source file:com.github.fge.jsonpatch.AddOperation.java
@Override public void applyToBuilder(ExpressionSpecBuilder builder) { final TokenResolver<JsonNode> node = Iterators.getLast(path.iterator(), null /*default*/); if (null == node || "-".equals(node.getToken().getRaw())) { //list_append throw new UnsupportedOperationException("list_append not supported yet"); } else {// w w w . j a v a2 s. c o m super.applyToBuilder(builder); } }
From source file:org.lbogdanov.poker.web.markup.ControlGroup.java
/** * Returns the last child <code>FormComponent</code>. * //from w w w. ja v a2 s .c o m * @return the last child of type <code>FormComponent</code> */ private FormComponent<?> lastFormComponent() { // TODO More tricky traversal? return (FormComponent<?>) Iterators.getLast(getBodyContainer().visitChildren(FormComponent.class), null); }