@ Nullable public SoyNode firstChildThatMatches ( Predicate < SoyNode > condition ) { int firstChildIndex = 0 ; while ( firstChildIndex < numChildren ( ) && ! condition . test ( getChild ( firstChildIndex ) ) ) { firstChildIndex ++ ; } if ( firstChildIndex < numChildren ( ) ) { return getChild ( firstChildIndex ) ; } return null ; }
Returns the template s first child node that matches the given condition .