public Builder withHeartbeatInterval(Duration heartbeatInterval){
  Assert.argNot(heartbeatInterval.isNegative() || heartbeatInterval.isZero(),"sessionTimeout must be positive");
  Assert.argNot(heartbeatInterval.toMillis() >= electionTimeout.toMillis(),"heartbeatInterval must be less than electionTimeout");
  this.heartbeatInterval=Assert.notNull(heartbeatInterval,"heartbeatInterval");
  return this;
}

public Builder withHeartbeatInterval ( Duration heartbeatInterval ) { Assert . argNot ( heartbeatInterval . isNegative ( ) || heartbeatInterval . isZero ( ) , "sessionTimeout must be positive" ) ; Assert . argNot ( heartbeatInterval . toMillis ( ) >= electionTimeout . toMillis ( ) , "heartbeatInterval must be less than electionTimeout" ) ; this . heartbeatInterval = Assert . notNull ( heartbeatInterval , "heartbeatInterval" ) ; return this ; }
sets the raft heartbeat interval , returning the raft configuration for method chaining .
