/** * <p> * An array of <code>Instance</code> objects that describe the instances. * </p> * * @param instances * An array of <code>Instance</code> objects that describe the instances. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeInstancesResult withInstances(java.util.Collection<Instance> instances) { setInstances(instances); return this; }
/** * <p> * An array of <code>Instance</code> objects that describe the instances. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setInstances(java.util.Collection)} or {@link #withInstances(java.util.Collection)} if you want to * override the existing values. * </p> * * @param instances * An array of <code>Instance</code> objects that describe the instances. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeInstancesResult withInstances(Instance... instances) { if (this.instances == null) { setInstances(new com.amazonaws.internal.SdkInternalList<Instance>(instances.length)); } for (Instance ele : instances) { this.instances.add(ele); } return this; }
public DescribeInstancesResult unmarshall(JsonUnmarshallerContext context) throws Exception { DescribeInstancesResult describeInstancesResult = new DescribeInstancesResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return describeInstancesResult; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Instances", targetDepth)) { context.nextToken(); describeInstancesResult.setInstances(new ListUnmarshaller<Instance>(InstanceJsonUnmarshaller.getInstance()).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return describeInstancesResult; }
/** * <p> * An array of <code>Instance</code> objects that describe the instances. * </p> * * @param instances * An array of <code>Instance</code> objects that describe the instances. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeInstancesResult withInstances(java.util.Collection<Instance> instances) { setInstances(instances); return this; }
/** * <p> * An array of <code>Instance</code> objects that describe the instances. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setInstances(java.util.Collection)} or {@link #withInstances(java.util.Collection)} if you want to * override the existing values. * </p> * * @param instances * An array of <code>Instance</code> objects that describe the instances. * @return Returns a reference to this object so that method calls can be chained together. */ public DescribeInstancesResult withInstances(Instance... instances) { if (this.instances == null) { setInstances(new com.amazonaws.internal.SdkInternalList<Instance>(instances.length)); } for (Instance ele : instances) { this.instances.add(ele); } return this; }
public DescribeInstancesResult unmarshall(JsonUnmarshallerContext context) throws Exception { DescribeInstancesResult describeInstancesResult = new DescribeInstancesResult(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) { return describeInstancesResult; } while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Instances", targetDepth)) { context.nextToken(); describeInstancesResult.setInstances(new ListUnmarshaller<Instance>(InstanceJsonUnmarshaller.getInstance()).unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return describeInstancesResult; }