public IndexOptions expireAfter(@Nullable final Long expireAfter, final TimeUnit timeUnit) {
    """
	Sets the time to live for documents in the collection
	
	@param expireAfter the time to live for documents in the collection
	@param timeUnit the time unit for expireAfter
	@return this
	@mongodb.driver.manual tutorial/expire-data TTL
    """
        if (expireAfter == null) {
            this.expireAfterSeconds = null;
        } else {
            this.expireAfterSeconds = TimeUnit.SECONDS.convert(expireAfter, timeUnit);
        }
        return this;
    }
public IndexOptions expireAfter(@Nullable final Long expireAfter, final TimeUnit timeUnit) {
        if (expireAfter == null) {
            this.expireAfterSeconds = null;
        } else {
            this.expireAfterSeconds = TimeUnit.SECONDS.convert(expireAfter, timeUnit);
        }
        return this;
    }
public IndexOptions expireAfter ( @ Nullable final Long expireAfter , final TimeUnit timeUnit ) { if ( expireAfter == null ) { this . expireAfterSeconds = null ; } else { this . expireAfterSeconds = TimeUnit . SECONDS . convert ( expireAfter , timeUnit ) ; } return this ; }
Sets the time to live for documents in the collection

@param expireAfter the time to live for documents in the collection
@param timeUnit the time unit for expireAfter
@return this
@mongodb.driver.manual tutorial/expire-data TTL
Sets the time to live for documents in the collection