All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.cloudfoundry.multiapps.controller.process.flowable.ProcessActionRegistry Maven / Gradle / Ivy

There is a newer version: 1.183.0
Show newest version
package org.cloudfoundry.multiapps.controller.process.flowable;

import java.text.MessageFormat;
import java.util.List;

import jakarta.inject.Inject;
import jakarta.inject.Named;

import org.cloudfoundry.multiapps.controller.process.Messages;

@Named
public class ProcessActionRegistry {

    private final List processActions;

    @Inject
    public ProcessActionRegistry(List processActions) {
        this.processActions = processActions;
    }

    public ProcessAction getAction(Action action) {
        return processActions.stream()
                             .filter(processAction -> processAction.getAction() == action)
                             .findFirst()
                             .orElseThrow(() -> new IllegalStateException(MessageFormat.format(Messages.NO_PROCESS_ACTION_FOUND,
                                                                                               action.getActionId())));
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy