org.jtrim2.taskgraph.TaskFactoryConfig Maven / Gradle / Ivy
package org.jtrim2.taskgraph;
import java.util.Objects;
/**
* Defines a complete definition of a task node factory.
*
* Thread safety
* The methods of this class can be safely accessed concurrently by multiple threads,
* even without any synchronization.
*
* Synchronization transparency
* The methods of this class are completely synchronization transparent.
*
* @param the return type of the task nodes created by the defined task node factory
* @param the type of the argument passed to the task node factory when requested for
* a node to be created
*
* @see TaskFactoryDefiner
*/
public final class TaskFactoryConfig {
private final TaskFactoryKey defKey;
private final TaskFactoryGroupConfigurer configurer;
private final TaskFactorySetup setup;
/**
* Creates a task node factory definition with the given properties.
*
* @param defKey the key uniquely identifying a task node factory.
* This argument cannot be {@code null}.
* @param configurer the method of defining the configuration of the associated
* task factory. This argument cannot be {@code null}.
* @param setup the deferred task node factory creator. This argument cannot be {@code null}.
*/
public TaskFactoryConfig(
TaskFactoryKey defKey,
TaskFactoryGroupConfigurer configurer,
TaskFactorySetup setup) {
Objects.requireNonNull(defKey, "defKey");
Objects.requireNonNull(configurer, "configurer");
Objects.requireNonNull(setup, "setup");
this.defKey = defKey;
this.configurer = configurer;
this.setup = setup;
}
/**
* Returns the key uniquely identifying the associated task node factory.
*
* @return the key uniquely identifying the associated task node factory.
* This method never returns {@code null}.
*/
public TaskFactoryKey getDefKey() {
return defKey;
}
/**
* Returns the method of defining the configuration of the associated task factory.
*
* @return the method of defining the configuration of the associated task factory.
* This method never returns {@code null}.
*/
public TaskFactoryGroupConfigurer getConfigurer() {
return configurer;
}
/**
* Returns the deferred task node factory creator.
*
* @return the deferred task node factory creator. This method never returns {@code null}.
*/
public TaskFactorySetup getSetup() {
return setup;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy