/** * <p> * For the metric that the CloudWatch alarm is associated with, the value of one dimension. * </p> * * @param value * For the metric that the CloudWatch alarm is associated with, the value of one dimension. * @return Returns a reference to this object so that method calls can be chained together. */ public Dimension withValue(String value) { setValue(value); return this; }
public Dimension unmarshall(StaxUnmarshallerContext context) throws Exception { Dimension dimension = new Dimension(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 1; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return dimension; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("Name", targetDepth)) { dimension.setName(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } if (context.testExpression("Value", targetDepth)) { dimension.setValue(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return dimension; } } } }