public SelectionSet build() { SelectionSet selectionSet = new SelectionSet(selections, sourceLocation, comments, ignoredChars); return selectionSet; } }
@Override public SelectionSet deepCopy() { return new SelectionSet(deepCopy(selections), getSourceLocation(), getComments(), getIgnoredChars()); }
public SelectionSet build() { SelectionSet selectionSet = new SelectionSet(selections, sourceLocation, comments, ignoredChars); return selectionSet; } }
protected final Stream<Field> selections(Field field) { SelectionSet selectionSet = field.getSelectionSet() != null ? field.getSelectionSet() : new SelectionSet(Collections.emptyList()); return selectionSet.getSelections() .stream() .filter(it -> it instanceof Field) .map(it -> (Field) it); }
protected final Stream<Field> flatten(Field field) { SelectionSet selectionSet = field.getSelectionSet() != null ? field.getSelectionSet() : new SelectionSet(Collections.emptyList()); return Stream.concat( Stream.of(field), selectionSet.getSelections() .stream() .filter(it -> it instanceof Field) .flatMap(selection -> this.flatten((Field) selection)) ); }
@Override public SelectionSet deepCopy() { return new SelectionSet(deepCopy(selections), getSourceLocation(), getComments(), getIgnoredChars()); }