Example usage for com.amazonaws.services.cloudformation.model Parameter withParameterKey

List of usage examples for com.amazonaws.services.cloudformation.model Parameter withParameterKey

Introduction

In this page you can find the example usage for com.amazonaws.services.cloudformation.model Parameter withParameterKey.

Prototype


public Parameter withParameterKey(String parameterKey) 

Source Link

Document

The key associated with the parameter.

Usage

From source file:de.taimos.pipeline.aws.cloudformation.parser.JSONParameterFileParser.java

License:Apache License

@Override
public Collection<Parameter> parseParams(InputStream fileContent) throws IOException {
    ObjectMapper mapper = new ObjectMapper();
    JsonNode tree = mapper.readTree(fileContent);
    Collection<Parameter> parameters = new ArrayList<>();
    if (tree instanceof ArrayNode) {
        ArrayNode jsonNodes = (ArrayNode) tree;
        for (JsonNode node : jsonNodes) {
            Parameter param = new Parameter();
            param.withParameterKey(node.get("ParameterKey").asText());
            if (node.has("ParameterValue")) {
                param.withParameterValue(node.get("ParameterValue").asText());
            }/*from  w  w  w.  j a va  2  s .  c om*/
            if (node.has("UsePreviousValue")) {
                param.withUsePreviousValue(node.get("UsePreviousValue").booleanValue());
            }
            parameters.add(param);
        }
    }
    return parameters;
}