Package io.openems.edge.core.appmanager
Record Class AppConfiguration
java.lang.Object
java.lang.Record
io.openems.edge.core.appmanager.AppConfiguration
public record AppConfiguration(List<Task<?>> tasks, List<DependencyDeclaration> dependencies)
extends Record
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAppConfiguration
(List<Task<?>> tasks, List<DependencyDeclaration> dependencies) Creates an instance of aAppConfiguration
record class. -
Method Summary
Modifier and TypeMethodDescriptioncreate()
Creates a builder for creating anAppConfiguration
.Returns the value of thedependencies
record component.static AppConfiguration
empty()
Creates an emptyAppConfiguration
.final boolean
Indicates whether some other object is "equal to" this one.static <C,
T extends AggregateTask<C>, L>
Stream<L> flatMap
(List<AppConfiguration> configs, Class<T> clazz, Function<C, Collection<L>> mapper) Flat maps a attribute from a configuration to a single list.static List
<EdgeConfig.Component> getComponentsFromConfigs
(List<AppConfiguration> configs) Collects all components from theAppConfigurations
and returns them.<C,
T extends AggregateTask<C>>
CgetConfiguration
(Class<T> clazz) Gets the configuration for the given task class.final int
hashCode()
Returns a hash code value for this object.tasks()
Returns the value of thetasks
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
AppConfiguration
Creates an instance of aAppConfiguration
record class.- Parameters:
tasks
- the value for thetasks
record componentdependencies
- the value for thedependencies
record component
-
-
Method Details
-
create
Creates a builder for creating anAppConfiguration
.- Returns:
- the builder
-
empty
Creates an emptyAppConfiguration
.- Returns:
- the configuration
-
getComponents
-
getConfiguration
Gets the configuration for the given task class.e. g. if
ComponentAggregateTask
is given which is aAggregateTask
ofComponentConfiguration
then this configuration is returned if defined in theAppConfiguration
else null.- Type Parameters:
C
- the type of the configurationT
- the type of theAggregateTask
- Parameters:
clazz
- theClass
of theAggregateTask
- Returns:
- the found configuration or null if not defined
-
flatMap
public static <C,T extends AggregateTask<C>, Stream<L> flatMapL> (List<AppConfiguration> configs, Class<T> clazz, Function<C, Collection<L>> mapper) Flat maps a attribute from a configuration to a single list.- Type Parameters:
C
- the type of the ConfigurationT
- the type of theAggregateTask
L
- the type of the list- Parameters:
configs
- the configurations to mapclazz
- theClass
of the Taskmapper
- the mapper from the configuration to the type of the list- Returns:
- the list with all instances
-
getComponentsFromConfigs
Collects all components from theAppConfigurations
and returns them.- Parameters:
configs
- theAppConfigurations
to get theComponents
from- Returns:
- the
Components
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
tasks
Returns the value of thetasks
record component.- Returns:
- the value of the
tasks
record component
-
dependencies
Returns the value of thedependencies
record component.- Returns:
- the value of the
dependencies
record component
-