public void setEntryTimeToLive(ExpirationAttributes timeToLive) {
    if (timeToLive == null) {
      throw new IllegalArgumentException(
          "timeToLive must not be null");
    }
    regionAttributes.entryTimeToLive = timeToLive.getTimeout();
    regionAttributes.entryTimeToLiveExpirationAction = timeToLive.getAction();
    regionAttributes.setHasEntryTimeToLive(true);
  }
Sets the timeToLive expiration attributes for region entries for the next
{@code RegionAttributes} created. Default is 0 which indicates no expiration of this type.

@param timeToLive the timeToLive ExpirationAttributes for entries in this region
@throws IllegalArgumentException if timeToLive is null
geode-core/src/main/java/org/apache/geode/cache/AttributesFactory.java