/** * <p> * The x-coordinate from the top left of the landmark expressed as the ratio of the width of the image. For example, * if the image is 700 x 200 and the x-coordinate of the landmark is at 350 pixels, this value is 0.5. * </p> * * @param x * The x-coordinate from the top left of the landmark expressed as the ratio of the width of the image. For * example, if the image is 700 x 200 and the x-coordinate of the landmark is at 350 pixels, this value is * 0.5. * @return Returns a reference to this object so that method calls can be chained together. */ public Landmark withX(Float x) { setX(x); return this; }
landmark.setX(context.getUnmarshaller(Float.class).unmarshall(context));
public Landmark unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } Landmark landmark = new Landmark(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Type")) { landmark.setType(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("X")) { landmark.setX(FloatJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("Y")) { landmark.setY(FloatJsonUnmarshaller.getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return landmark; }