
pl.wrzasq.commons.aws.cloudformation.macro.TemplateUtils Maven / Gradle / Ivy
/*
* This file is part of the pl.wrzasq.commons.
*
* @license http://mit-license.org/ The MIT license
* @copyright 2020 © by Rafał Wrzeszcz - Wrzasq.pl.
*/
package pl.wrzasq.commons.aws.cloudformation.macro;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
/**
* CloudFormation template utilities.
*/
public class TemplateUtils {
/**
* Parameters section key.
*/
public static final String SECTION_PARAMETERS = "Parameters";
/**
* Conditions section key.
*/
public static final String SECTION_CONDITIONS = "Conditions";
/**
* Resources section key.
*/
public static final String SECTION_RESOURCES = "Resources";
/**
* Resources section key.
*/
public static final String SECTION_OUTPUTS = "Outputs";
/**
* Property key "Type".
*/
public static final String PROPERTY_KEY_TYPE = "Type";
/**
* Property key "DependsOn".
*/
public static final String PROPERTY_KEY_DEPENDSON = "DependsOn";
/**
* Property key "Condition".
*/
public static final String PROPERTY_KEY_CONDITION = "Condition";
/**
* Property key "Properties".
*/
public static final String PROPERTY_KEY_PROPERTIES = "Properties";
/**
* Handles optional property by removing it from generic properties pool.
*
* @param properties Main properties container.
* @param key Property key.
* @param then Property action.
* @param defaultValue Default property value.
*/
public static void popProperty(
Map properties,
String key,
Consumer
© 2015 - 2025 Weber Informatics LLC | Privacy Policy