Skip to content

Commit

Permalink
Remove maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
jasontedor committed Oct 6, 2017
1 parent 8f8b384 commit 0ba19c6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ private EngineFactory getEngineFactory(final IndexSettings idxSettings) {
final List<Tuple<EnginePlugin, Optional<EngineFactory>>> engineFactories =
enginePlugins
.stream()
.map(p -> Tuple.tuple(p, p.getMaybeEngineFactory(idxSettings)))
.map(p -> Tuple.tuple(p, p.getEngineFactory(idxSettings)))
.filter(t -> Objects.requireNonNull(t.v2()).isPresent())
.collect(Collectors.toList());
if (engineFactories.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ public interface EnginePlugin {
*
* @return an optional engine factory
*/
Optional<EngineFactory> getMaybeEngineFactory(IndexSettings indexSettings);
Optional<EngineFactory> getEngineFactory(IndexSettings indexSettings);

}
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public List<Setting<?>> getSettings() {
}

@Override
public Optional<EngineFactory> getMaybeEngineFactory(final IndexSettings indexSettings) {
public Optional<EngineFactory> getEngineFactory(final IndexSettings indexSettings) {
if (FOO_INDEX_SETTING.get(indexSettings.getSettings())) {
return Optional.of(new FooEngineFactory());
} else {
Expand Down Expand Up @@ -156,7 +156,7 @@ public List<Setting<?>> getSettings() {
}

@Override
public Optional<EngineFactory> getMaybeEngineFactory(final IndexSettings indexSettings) {
public Optional<EngineFactory> getEngineFactory(final IndexSettings indexSettings) {
if (BAR_INDEX_SETTING.get(indexSettings.getSettings())) {
return Optional.of(new BarEngineFactory());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public List<Setting<?>> getSettings() {
}

@Override
public Optional<EngineFactory> getMaybeEngineFactory(final IndexSettings indexSettings) {
public Optional<EngineFactory> getEngineFactory(final IndexSettings indexSettings) {
return Optional.of(new MockEngineFactory(getReaderWrapperClass()));
}

Expand Down

0 comments on commit 0ba19c6

Please sign in to comment.