public CapacityReservationSpecification withCapacityReservationPreference(CapacityReservationPreference capacityReservationPreference) {
        this.capacityReservationPreference = capacityReservationPreference.toString();
        return this;
    }
<p>
Indicates the instance's Capacity Reservation preferences. Possible preferences include:
</p>
<ul>
<li>
<p>
<code>open</code> - The instance can run in any <code>open</code> Capacity Reservation that has matching
attributes (instance type, platform, Availability Zone).
</p>
</li>
<li>
<p>
<code>none</code> - The instance avoids running in a Capacity Reservation even if one is available. The instance
runs as an On-Demand Instance.
</p>
</li>
</ul>

@param capacityReservationPreference
       Indicates the instance's Capacity Reservation preferences. Possible preferences include:</p>
       <ul>
       <li>
       <p>
       <code>open</code> - The instance can run in any <code>open</code> Capacity Reservation that has matching
       attributes (instance type, platform, Availability Zone).
       </p>
       </li>
       <li>
       <p>
       <code>none</code> - The instance avoids running in a Capacity Reservation even if one is available. The
       instance runs as an On-Demand Instance.
       </p>
       </li>
@return Returns a reference to this object so that method calls can be chained together.
@see CapacityReservationPreference
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/CapacityReservationSpecification.java