/** * <p> * An array of labels for the real-world objects detected. * </p> * * @param labels * An array of labels for the real-world objects detected. * @return Returns a reference to this object so that method calls can be chained together. */ public DetectLabelsResult withLabels(java.util.Collection<Label> labels) { setLabels(labels); return this; }
/** * <p> * An array of labels for the real-world objects detected. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setLabels(java.util.Collection)} or {@link #withLabels(java.util.Collection)} if you want to override the * existing values. * </p> * * @param labels * An array of labels for the real-world objects detected. * @return Returns a reference to this object so that method calls can be chained together. */ public DetectLabelsResult withLabels(Label... labels) { if (this.labels == null) { setLabels(new java.util.ArrayList<Label>(labels.length)); } for (Label ele : labels) { this.labels.add(ele); } return this; }
if (context.testExpression("Labels", targetDepth)) { context.nextToken(); detectLabelsResult.setLabels(new ListUnmarshaller<Label>(LabelJsonUnmarshaller.getInstance()).unmarshall(context));
/** * <p> * An array of labels for the real-world objects detected. * </p> * <p> * Returns a reference to this object so that method calls can be chained * together. * * @param labels <p> * An array of labels for the real-world objects detected. * </p> * @return A reference to this updated object so that method calls can be * chained together. */ public DetectLabelsResult withLabels(java.util.Collection<Label> labels) { setLabels(labels); return this; }
public DetectLabelsResult unmarshall(JsonUnmarshallerContext context) throws Exception { DetectLabelsResult detectLabelsResult = new DetectLabelsResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Labels")) { detectLabelsResult.setLabels(new ListUnmarshaller<Label>(LabelJsonUnmarshaller .getInstance() ) .unmarshall(context)); } else if (name.equals("OrientationCorrection")) { detectLabelsResult.setOrientationCorrection(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return detectLabelsResult; }