public static LabelJsonUnmarshaller getInstance() { if (instance == null) instance = new LabelJsonUnmarshaller(); return instance; } }
labelDetection.setLabel(LabelJsonUnmarshaller.getInstance().unmarshall(context));
if (context.testExpression("Labels", targetDepth)) { context.nextToken(); detectLabelsResult.setLabels(new ListUnmarshaller<Label>(LabelJsonUnmarshaller.getInstance()).unmarshall(context));
public LabelDetection unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } LabelDetection labelDetection = new LabelDetection(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Timestamp")) { labelDetection.setTimestamp(LongJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Label")) { labelDetection.setLabel(LabelJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return labelDetection; }
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; }
public static LabelJsonUnmarshaller getInstance() { if (instance == null) instance = new LabelJsonUnmarshaller(); return instance; } }