Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove .build() function from Builders #223

Closed
simerplaha opened this issue Mar 20, 2020 · 0 comments
Closed

Remove .build() function from Builders #223

simerplaha opened this issue Mar 20, 2020 · 0 comments
Labels
java For Java API

Comments

@simerplaha
Copy link
Owner

simerplaha commented Mar 20, 2020

Since Builders require all fields to be instantiated .build() is unnecessary and the objects should be created when the last configuration is set.

MightContainIndex.builder()
  .withFalsePositiveRate(0.01)
  .withUpdateMaxProbe(optimalMaxProbe -> 1)
  .withMinimumNumberOfKeys(10)
  .withIoStrategy(ioAction -> new IOStrategy.SynchronisedIO(true))
  .withCompression(info -> Collections.emptyList())
  .build()

should be

MightContainIndex.builder()
  .withFalsePositiveRate(0.01)
  .withUpdateMaxProbe(optimalMaxProbe -> 1)
  .withMinimumNumberOfKeys(10)
  .withIoStrategy(ioAction -> new IOStrategy.SynchronisedIO(true))
  .withCompression(info -> Collections.emptyList())
@simerplaha simerplaha added the java For Java API label Mar 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
java For Java API
Projects
None yet
Development

No branches or pull requests

1 participant