public void setAffinity(String affinity) {
        this.affinity = affinity;
    }
<p>
The affinity setting for the instance on the Dedicated Host.
</p>

@param affinity
       The affinity setting for the instance on the Dedicated Host.
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/LaunchTemplatePlacement.java