Class SchedulerByCentralOrderAggregateTaskImpl.SchedulerOrderDefinition
java.lang.Object
io.openems.edge.core.appmanager.dependency.aggregatetask.SchedulerByCentralOrderAggregateTaskImpl.SchedulerOrderDefinition
- All Implemented Interfaces:
Comparator<SchedulerByCentralOrderConfiguration.SchedulerComponent>
- Direct Known Subclasses:
SchedulerByCentralOrderAggregateTaskImpl.ProductionSchedulerOrderDefinition
- Enclosing class:
SchedulerByCentralOrderAggregateTaskImpl
public static class SchedulerByCentralOrderAggregateTaskImpl.SchedulerOrderDefinition
extends Object
implements Comparator<SchedulerByCentralOrderConfiguration.SchedulerComponent>
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compare
(SchedulerByCentralOrderConfiguration.SchedulerComponent o1, SchedulerByCentralOrderConfiguration.SchedulerComponent o2) boolean
Checks if the givenSchedulerByCentralOrderConfiguration.SchedulerComponent
is handled by thisSchedulerByCentralOrderAggregateTaskImpl.SchedulerOrderDefinition
.Adds a filter to the order queue which sorts out everySchedulerByCentralOrderConfiguration.SchedulerComponent
which does not match thePredicate
.filterByFactoryId
(String factoryId) Adds a filter to the order queue which sorts out everySchedulerByCentralOrderConfiguration.SchedulerComponent
which does not match the factoryId.rest()
Adds the rest of theSchedulerByCentralOrderConfiguration.SchedulerComponent
at this position which got not filtered out before.Adds a Sub-Order at the current position.Adds a matching function if the currentSchedulerByCentralOrderConfiguration.SchedulerComponent
is at the right position.thenByCreatedAppId
(String appId) Adds a matching function if the currentSchedulerByCentralOrderConfiguration.SchedulerComponent
matches the appId.thenByFactoryId
(String factoryId) Adds a matching function if the currentSchedulerByCentralOrderConfiguration.SchedulerComponent
matches the factoryId.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
SchedulerOrderDefinition
public SchedulerOrderDefinition()
-
-
Method Details
-
filterBy
public SchedulerByCentralOrderAggregateTaskImpl.SchedulerOrderDefinition filterBy(Predicate<SchedulerByCentralOrderConfiguration.SchedulerComponent> matcher) Adds a filter to the order queue which sorts out everySchedulerByCentralOrderConfiguration.SchedulerComponent
which does not match thePredicate
.- Parameters:
matcher
- the predicate to determine if the currentSchedulerByCentralOrderConfiguration.SchedulerComponent
should be filtered out or not; true for continuing to next check; false for removing theSchedulerByCentralOrderConfiguration.SchedulerComponent
- Returns:
- this
-
filterByFactoryId
public SchedulerByCentralOrderAggregateTaskImpl.SchedulerOrderDefinition filterByFactoryId(String factoryId) Adds a filter to the order queue which sorts out everySchedulerByCentralOrderConfiguration.SchedulerComponent
which does not match the factoryId.- Parameters:
factoryId
- the factoryId to determine if the currentSchedulerByCentralOrderConfiguration.SchedulerComponent
should be filtered out or not; same for continuing to next check; different for removing theSchedulerByCentralOrderConfiguration.SchedulerComponent
- Returns:
- this
-
thenBy
public SchedulerByCentralOrderAggregateTaskImpl.SchedulerOrderDefinition thenBy(Predicate<SchedulerByCentralOrderConfiguration.SchedulerComponent> matcher) Adds a matching function if the currentSchedulerByCentralOrderConfiguration.SchedulerComponent
is at the right position.- Parameters:
matcher
- the predicate if the currentSchedulerByCentralOrderConfiguration.SchedulerComponent
is at the right position; true if theSchedulerByCentralOrderConfiguration.SchedulerComponent
is at the right position; false if theSchedulerByCentralOrderConfiguration.SchedulerComponent
should continue to the next function- Returns:
- this
-
thenBy
public SchedulerByCentralOrderAggregateTaskImpl.SchedulerOrderDefinition thenBy(SchedulerByCentralOrderAggregateTaskImpl.SchedulerOrderDefinition order) Adds a Sub-Order at the current position.- Parameters:
order
- the Sub-Order- Returns:
- this
-
thenByFactoryId
public SchedulerByCentralOrderAggregateTaskImpl.SchedulerOrderDefinition thenByFactoryId(String factoryId) Adds a matching function if the currentSchedulerByCentralOrderConfiguration.SchedulerComponent
matches the factoryId.- Parameters:
factoryId
- the factoryId if the currentSchedulerByCentralOrderConfiguration.SchedulerComponent
has the same factoryId it is inserted at this position; otherwise theSchedulerByCentralOrderConfiguration.SchedulerComponent
continues to the next function should continue to the next function- Returns:
- this
-
thenByCreatedAppId
public SchedulerByCentralOrderAggregateTaskImpl.SchedulerOrderDefinition thenByCreatedAppId(String appId) Adds a matching function if the currentSchedulerByCentralOrderConfiguration.SchedulerComponent
matches the appId. right position.- Parameters:
appId
- the appId if the currentSchedulerByCentralOrderConfiguration.SchedulerComponent
has the same appId it is inserted at this position; otherwise theSchedulerByCentralOrderConfiguration.SchedulerComponent
continues to the next function should continue to the next function- Returns:
- this
-
rest
Adds the rest of theSchedulerByCentralOrderConfiguration.SchedulerComponent
at this position which got not filtered out before.- Returns:
- this
-
compare
public int compare(SchedulerByCentralOrderConfiguration.SchedulerComponent o1, SchedulerByCentralOrderConfiguration.SchedulerComponent o2) - Specified by:
compare
in interfaceComparator<SchedulerByCentralOrderConfiguration.SchedulerComponent>
-
contains
Checks if the givenSchedulerByCentralOrderConfiguration.SchedulerComponent
is handled by thisSchedulerByCentralOrderAggregateTaskImpl.SchedulerOrderDefinition
.- Parameters:
o
- theSchedulerByCentralOrderConfiguration.SchedulerComponent
- Returns:
- true if the
SchedulerByCentralOrderConfiguration.SchedulerComponent
is handled by this order
-