Created
August 30, 2019 18:13
-
-
Save arhimondr/6563d1dcd0ad084c25ebd67c3774be89 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class Parts | |
{ | |
private final Optional<StatisticAggregations> finalAggregation; | |
private final Optional<StatisticAggregations> intermediateAggregation; | |
private final StatisticAggregations partialAggregation; | |
public Parts( | |
Optional<StatisticAggregations> finalAggregation, | |
Optional<StatisticAggregations> intermediateAggregation, | |
StatisticAggregations partialAggregation) | |
{ | |
this.finalAggregation = requireNonNull(finalAggregation, "finalAggregation is null"); | |
this.intermediateAggregation = requireNonNull(intermediateAggregation, "intermediateAggregation is null"); | |
this.partialAggregation = requireNonNull(partialAggregation, "partialAggregation is null"); | |
} | |
public StatisticAggregations getFinalAggregation() | |
{ | |
return finalAggregation.orElseThrow(() -> new IllegalStateException("finalAggregation is not present")); | |
} | |
public StatisticAggregations getIntermediateAggregation() | |
{ | |
return intermediateAggregation.orElseThrow(() -> new IllegalStateException("intermediateAggregation is not present")); | |
} | |
public StatisticAggregations getPartialAggregation() | |
{ | |
return partialAggregation; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment