public static CelebrityDetailJsonUnmarshaller getInstance() { if (instance == null) instance = new CelebrityDetailJsonUnmarshaller(); return instance; } }
celebrityRecognition.setCelebrity(CelebrityDetailJsonUnmarshaller.getInstance().unmarshall(context));
public CelebrityRecognition unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } CelebrityRecognition celebrityRecognition = new CelebrityRecognition(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Timestamp")) { celebrityRecognition.setTimestamp(LongJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Celebrity")) { celebrityRecognition.setCelebrity(CelebrityDetailJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return celebrityRecognition; }
public static CelebrityDetailJsonUnmarshaller getInstance() { if (instance == null) instance = new CelebrityDetailJsonUnmarshaller(); return instance; } }