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

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

Introduction

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

Prototype


public Parameter withParameterValue(String parameterValue) 

Source Link

Document

The input value 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());
            }/*ww  w. j  a  v a 2s  . co m*/
            if (node.has("UsePreviousValue")) {
                param.withUsePreviousValue(node.get("UsePreviousValue").booleanValue());
            }
            parameters.add(param);
        }
    }
    return parameters;
}