public class MetricUnmarshaller extends AbstractUnmarshaller<Metric> {
@Override
protected Metric parse(Object json) {
WSUtils utils = WSUtils.getINSTANCE();
return new Metric()
.setKey(utils.getString(json, "key"))
.setName(utils.getString(json, "name"))
.setDomain(utils.getString(json, "domain"))
.setDescription(utils.getString(json, "description"))
.setDirection(utils.getInteger(json, "direction"))
.setType(utils.getString(json, "val_type"))
.setUserManaged(utils.getBoolean(json, "user_managed"))
.setHidden(utils.getBoolean(json, "hidden"));
}