public static FaceMatchJsonUnmarshaller getInstance() { if (instance == null) instance = new FaceMatchJsonUnmarshaller(); return instance; } }
searchFacesResult.setFaceMatches(new ListUnmarshaller<FaceMatch>(FaceMatchJsonUnmarshaller.getInstance()).unmarshall(context));
personMatch.setFaceMatches(new ListUnmarshaller<FaceMatch>(FaceMatchJsonUnmarshaller.getInstance()).unmarshall(context));
searchFacesByImageResult.setFaceMatches(new ListUnmarshaller<FaceMatch>(FaceMatchJsonUnmarshaller.getInstance()).unmarshall(context));
public static FaceMatchJsonUnmarshaller getInstance() { if (instance == null) instance = new FaceMatchJsonUnmarshaller(); return instance; } }
public SearchFacesResult unmarshall(JsonUnmarshallerContext context) throws Exception { SearchFacesResult searchFacesResult = new SearchFacesResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("SearchedFaceId")) { searchFacesResult.setSearchedFaceId(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("FaceMatches")) { searchFacesResult.setFaceMatches(new ListUnmarshaller<FaceMatch>( FaceMatchJsonUnmarshaller.getInstance() ) .unmarshall(context)); } else if (name.equals("FaceModelVersion")) { searchFacesResult.setFaceModelVersion(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return searchFacesResult; }
public SearchFacesByImageResult unmarshall(JsonUnmarshallerContext context) throws Exception { SearchFacesByImageResult searchFacesByImageResult = new SearchFacesByImageResult(); AwsJsonReader reader = context.getReader(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("SearchedFaceBoundingBox")) { searchFacesByImageResult.setSearchedFaceBoundingBox(BoundingBoxJsonUnmarshaller .getInstance() .unmarshall(context)); } else if (name.equals("SearchedFaceConfidence")) { searchFacesByImageResult.setSearchedFaceConfidence(FloatJsonUnmarshaller .getInstance() .unmarshall(context)); } else if (name.equals("FaceMatches")) { searchFacesByImageResult.setFaceMatches(new ListUnmarshaller<FaceMatch>( FaceMatchJsonUnmarshaller.getInstance() ) .unmarshall(context)); } else if (name.equals("FaceModelVersion")) { searchFacesByImageResult.setFaceModelVersion(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return searchFacesByImageResult; }
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; }