Skip to content

Commit

Permalink
improvement
Browse files Browse the repository at this point in the history
Signed-off-by: Jan N. Klug <[email protected]>
  • Loading branch information
J-N-K committed May 29, 2023
1 parent 742272b commit de52a25
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -498,8 +498,7 @@ public void setCategory(@Nullable String category) {
* @return true if state is an acceptedDataType or subclass thereof
*/
public boolean isAcceptedState(List<Class<? extends State>> acceptedDataTypes, State state) {
return acceptedDataTypes.stream().map(clazz -> clazz.isAssignableFrom(state.getClass())).filter(found -> found)
.findAny().isPresent();
return acceptedDataTypes.stream().anyMatch(clazz -> clazz.isAssignableFrom(state.getClass()));
}

protected void logSetTypeError(State state) {
Expand All @@ -512,7 +511,7 @@ protected void logSetTypeError(TimeSeries timeSeries) {
getName(), getClass().getSimpleName());
}

private @Nullable CommandDescription stateOptions2CommandOptions(StateDescription stateDescription) {
private CommandDescription stateOptions2CommandOptions(StateDescription stateDescription) {
CommandDescriptionBuilder builder = CommandDescriptionBuilder.create();
stateDescription.getOptions()
.forEach(so -> builder.withCommandOption(new CommandOption(so.getValue(), so.getLabel())));
Expand Down

0 comments on commit de52a25

Please sign in to comment.