/** * The list of OS platforms compatible with this SSM document. * * <p><b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link * #setPlatformTypes(java.util.Collection)} or {@link #withPlatformTypes(java.util.Collection)} if * you want to override the existing values. * * @param platformTypes The list of OS platforms compatible with this SSM document. * @return Returns a reference to this object so that method calls can be chained together. * @see PlatformType */ public DocumentDescription withPlatformTypes(String... platformTypes) { if (this.platformTypes == null) { setPlatformTypes(new com.amazonaws.internal.SdkInternalList<String>(platformTypes.length)); } for (String ele : platformTypes) { this.platformTypes.add(ele); } return this; }
/** * The list of OS platforms compatible with this SSM document. * * @param platformTypes The list of OS platforms compatible with this SSM document. * @return Returns a reference to this object so that method calls can be chained together. * @see PlatformType */ public DocumentDescription withPlatformTypes(PlatformType... platformTypes) { com.amazonaws.internal.SdkInternalList<String> platformTypesCopy = new com.amazonaws.internal.SdkInternalList<String>(platformTypes.length); for (PlatformType value : platformTypes) { platformTypesCopy.add(value.toString()); } if (getPlatformTypes() == null) { setPlatformTypes(platformTypesCopy); } else { getPlatformTypes().addAll(platformTypesCopy); } return this; }
/** * The list of OS platforms compatible with this SSM document. * * @param platformTypes The list of OS platforms compatible with this SSM document. * @return Returns a reference to this object so that method calls can be chained together. * @see PlatformType */ public DocumentDescription withPlatformTypes(java.util.Collection<String> platformTypes) { setPlatformTypes(platformTypes); return this; }
public DocumentDescription unmarshall(JsonUnmarshallerContext context) throws Exception { DocumentDescription documentDescription = new DocumentDescription(); int originalDepth = context.getCurrentDepth(); String currentParentElement = context.getCurrentParentElement(); int targetDepth = originalDepth + 1; JsonToken token = context.getCurrentToken(); if (token == null) token = context.nextToken(); if (token == VALUE_NULL) return null; while (true) { if (token == null) break; if (token == FIELD_NAME || token == START_OBJECT) { if (context.testExpression("Sha1", targetDepth)) { context.nextToken(); documentDescription.setSha1(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("Hash", targetDepth)) { context.nextToken(); documentDescription.setHash(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("HashType", targetDepth)) { context.nextToken(); documentDescription.setHashType( context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("Name", targetDepth)) { context.nextToken(); documentDescription.setName(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("Owner", targetDepth)) { context.nextToken(); documentDescription.setOwner(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("CreatedDate", targetDepth)) { context.nextToken(); documentDescription.setCreatedDate( context.getUnmarshaller(java.util.Date.class).unmarshall(context)); } if (context.testExpression("Status", targetDepth)) { context.nextToken(); documentDescription.setStatus(context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("Description", targetDepth)) { context.nextToken(); documentDescription.setDescription( context.getUnmarshaller(String.class).unmarshall(context)); } if (context.testExpression("Parameters", targetDepth)) { context.nextToken(); documentDescription.setParameters( new ListUnmarshaller<DocumentParameter>( DocumentParameterJsonUnmarshaller.getInstance()) .unmarshall(context)); } if (context.testExpression("PlatformTypes", targetDepth)) { context.nextToken(); documentDescription.setPlatformTypes( new ListUnmarshaller<String>(context.getUnmarshaller(String.class)) .unmarshall(context)); } } else if (token == END_ARRAY || token == END_OBJECT) { if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) { if (context.getCurrentDepth() <= originalDepth) break; } } token = context.nextToken(); } return documentDescription; }