public static PlacementTypeUnmarshaller GetInstance() { if (instance == null) { instance = new PlacementTypeUnmarshaller(); } return(instance); }
public JobFlowInstancesDetail Unmarshall(UnmarshallerContext context) { JobFlowInstancesDetail jobFlowInstancesDetail = new JobFlowInstancesDetail(); int originalDepth = context.CurrentDepth; int targetDepth = originalDepth + 1; if (context.IsStartOfDocument) { targetDepth += 2; } while (context.Read()) { if (context.IsStartElement || context.IsAttribute) { if (context.TestExpression("MasterInstanceType", targetDepth)) { jobFlowInstancesDetail.MasterInstanceType = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("MasterPublicDnsName", targetDepth)) { jobFlowInstancesDetail.MasterPublicDnsName = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("MasterInstanceId", targetDepth)) { jobFlowInstancesDetail.MasterInstanceId = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("SlaveInstanceType", targetDepth)) { jobFlowInstancesDetail.SlaveInstanceType = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("InstanceCount", targetDepth)) { jobFlowInstancesDetail.InstanceCount = IntUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("InstanceGroups/member", targetDepth)) { jobFlowInstancesDetail.InstanceGroups.Add(InstanceGroupDetailUnmarshaller.GetInstance().Unmarshall(context)); continue; } if (context.TestExpression("NormalizedInstanceHours", targetDepth)) { jobFlowInstancesDetail.NormalizedInstanceHours = IntUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Ec2KeyName", targetDepth)) { jobFlowInstancesDetail.Ec2KeyName = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("Placement", targetDepth)) { jobFlowInstancesDetail.Placement = PlacementTypeUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("KeepJobFlowAliveWhenNoSteps", targetDepth)) { jobFlowInstancesDetail.KeepJobFlowAliveWhenNoSteps = BoolUnmarshaller.GetInstance().Unmarshall(context); continue; } if (context.TestExpression("HadoopVersion", targetDepth)) { jobFlowInstancesDetail.HadoopVersion = StringUnmarshaller.GetInstance().Unmarshall(context); continue; } } else if (context.IsEndElement && context.CurrentDepth < originalDepth) { return(jobFlowInstancesDetail); } } return(jobFlowInstancesDetail); }