public static PersonDetailJsonUnmarshaller getInstance() { if (instance == null) instance = new PersonDetailJsonUnmarshaller(); return instance; } }
personMatch.setPerson(PersonDetailJsonUnmarshaller.getInstance().unmarshall(context));
personDetection.setPerson(PersonDetailJsonUnmarshaller.getInstance().unmarshall(context));
public PersonMatch unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } PersonMatch personMatch = new PersonMatch(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Timestamp")) { personMatch.setTimestamp(LongJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Person")) { personMatch.setPerson(PersonDetailJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("FaceMatches")) { personMatch.setFaceMatches(new ListUnmarshaller<FaceMatch>( FaceMatchJsonUnmarshaller.getInstance() ) .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return personMatch; }
public static PersonDetailJsonUnmarshaller getInstance() { if (instance == null) instance = new PersonDetailJsonUnmarshaller(); return instance; } }
public PersonDetection unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } PersonDetection personDetection = new PersonDetection(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Timestamp")) { personDetection.setTimestamp(LongJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Person")) { personDetection.setPerson(PersonDetailJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return personDetection; }