/** * <p> * The token to use to retrieve the next page of results. This value is <code>null</code> when there are no more * results to return. * </p> * * @param nextToken * The token to use to retrieve the next page of results. This value is <code>null</code> when there are no * more results to return. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeInstancesResult withNextToken(String nextToken) { setNextToken(nextToken); return this; }
public DescribeInstancesResult unmarshall(StaxUnmarshallerContext context) throws Exception { DescribeInstancesResult describeInstancesResult = new DescribeInstancesResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return describeInstancesResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("reservationSet", targetDepth)) { describeInstancesResult.withReservations(new ArrayList<Reservation>()); continue; } if (context.testExpression("reservationSet/item", targetDepth)) { describeInstancesResult.withReservations(ReservationStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("nextToken", targetDepth)) { describeInstancesResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return describeInstancesResult; } } } }
/** * <p> * The token to use to retrieve the next page of results. This value is <code>null</code> when there are no more * results to return. * </p> * * @param nextToken * The token to use to retrieve the next page of results. This value is <code>null</code> when there are no * more results to return. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeInstancesResult withNextToken(String nextToken) { setNextToken(nextToken); return this; }
public DescribeInstancesResult unmarshall(StaxUnmarshallerContext context) throws Exception { DescribeInstancesResult describeInstancesResult = new DescribeInstancesResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { int xmlEvent = context.nextEvent(); if (xmlEvent == XmlPullParser.END_DOCUMENT) return describeInstancesResult; if (xmlEvent == XmlPullParser.START_TAG) { if (context.testExpression("reservationSet/item", targetDepth)) { describeInstancesResult.getReservations().add(ReservationStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("nextToken", targetDepth)) { describeInstancesResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent == XmlPullParser.END_TAG) { if (context.getCurrentDepth() < originalDepth) { return describeInstancesResult; } } } }
public DescribeInstancesResult unmarshall(StaxUnmarshallerContext context) throws Exception { DescribeInstancesResult describeInstancesResult = new DescribeInstancesResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return describeInstancesResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("reservationSet", targetDepth)) { describeInstancesResult.withReservations(new ArrayList<Reservation>()); continue; } if (context.testExpression("reservationSet/item", targetDepth)) { describeInstancesResult.withReservations(ReservationStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("nextToken", targetDepth)) { describeInstancesResult.setNextToken(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return describeInstancesResult; } } } }