public class MandatoryAndOptionalComponentsMonitor extends java.lang.Object implements ComponentsMonitor
| Modifier and Type | Field and Description |
|---|---|
private ComponentsMonitor |
mandatoryComponentsMonitor
The mandatory components monitor.
|
private ComponentsMonitor |
optionalComponentsMonitor
The optional components monitor.
|
| Constructor and Description |
|---|
MandatoryAndOptionalComponentsMonitor(java.lang.String[] mandatoryComponents,
java.lang.String[] optionalComponents)
Instantiates a new mandatory and optional components monitor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
allComponentsUsed()
Check if all components are used.
|
boolean |
finalStateValid()
Checks if the final state is valid.
|
java.util.List<java.lang.String> |
getRemainingComponents()
Gets the remaining components.
|
ComponentsMonitor |
useComponent(java.lang.String component)
Use a component.
|
private ComponentsMonitor mandatoryComponentsMonitor
private ComponentsMonitor optionalComponentsMonitor
public MandatoryAndOptionalComponentsMonitor(java.lang.String[] mandatoryComponents,
java.lang.String[] optionalComponents)
throws java.lang.IllegalArgumentException
mandatoryComponents - the mandatory componentsoptionalComponents - the optional componentsjava.lang.IllegalArgumentException - if the same component is defined as mandatory and optionalpublic ComponentsMonitor useComponent(java.lang.String component)
useComponent in interface ComponentsMonitorcomponent - the componentpublic boolean allComponentsUsed()
allComponentsUsed in interface ComponentsMonitorpublic boolean finalStateValid()
finalStateValid in interface ComponentsMonitorpublic java.util.List<java.lang.String> getRemainingComponents()
getRemainingComponents in interface ComponentsMonitor