/** * <p> * A string that identifies the next page of stacks that you want to retrieve. * </p> * * @param nextToken * A string that identifies the next page of stacks that you want to retrieve. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeStacksRequest withNextToken(String nextToken) { setNextToken(nextToken); return this; }
/** * <p> * A string that identifies the next page of stacks that you want to retrieve. * </p> * * @param nextToken * A string that identifies the next page of stacks that you want to retrieve. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeStacksRequest withNextToken(String nextToken) { setNextToken(nextToken); return this; }
private Collection<Output> listOutputs() { if (isEmpty(stackId)) { return Collections.emptyList(); } String nextToken = null; final DescribeStacksRequest request = new DescribeStacksRequest().withStackName(stackId); List<Output> result = new ArrayList<>(); do { request.setNextToken(nextToken); final DescribeStacksResult response = getService().describeStacks(request); result.addAll(response.getStacks().stream().flatMap(stack -> stack.getOutputs().stream()).collect(Collectors.toList())); nextToken = response.getNextToken(); } while (null != nextToken); return result; } }