
macros.marshaller.common.RequiredParameterValidationFunctionMacro.ftl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of aws-java-sdk-code-generator Show documentation
Show all versions of aws-java-sdk-code-generator Show documentation
The AWS SDK for Java - Code Generator module holds the classes and templates required to generate the AWS Java SDK clients for AWS services.
<#macro content customConfig shape>
<#if customConfig.requiredParamValidationEnabled && shape.required?has_content>
<#local requiredParams = shape.required/>
private static void validateRequiredParams(${shape.variable.variableType} ${shape.variable.variableName}) {
<#if shape.members?has_content>
<#list shape.members as member>
<#local c2jName = member.c2jName/>
<#if requiredParams?seq_contains(c2jName)>
if (${shape.variable.variableName}.get${member.name}() == null) {
throw new IllegalArgumentException("Required Parameter ${member.name} missing in structure ${shape.variable.variableType}");
}
#if>
#list>
#if>
}
#if>
#macro>
© 2015 - 2025 Weber Informatics LLC | Privacy Policy