public FunctionConfiguration withLayers(Layer... layers) {
        if (this.layers == null) {
            setLayers(new com.amazonaws.internal.SdkInternalList<Layer>(layers.length));
        }
        for (Layer ele : layers) {
            this.layers.add(ele);
        }
        return this;
    }
<p>
The function's <a href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html">layers</a>.
</p>
<p>
<b>NOTE:</b> This method appends the values to the existing list (if any). Use
{@link #setLayers(java.util.Collection)} or {@link #withLayers(java.util.Collection)} if you want to override the
existing values.
</p>

@param layers
       The function's <a
       href="https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html">layers</a>.
@return Returns a reference to this object so that method calls can be chained together.
aws-java-sdk-lambda/src/main/java/com/amazonaws/services/lambda/model/FunctionConfiguration.java