public static class ModuleDescriptor.Builder
extends java.lang.Object
ModuleDescriptor
.
This object is mutable to allow for flexibility in specifying module
type/fields/parameters during parsing.Constructor and Description |
---|
ModuleDescriptor.Builder() |
Modifier and Type | Method and Description |
---|---|
ModuleDescriptor.Builder |
addChildren(java.util.List<ModuleDescriptor> children)
Add the list of children to the list of sub modules.
|
ModuleDescriptor.Builder |
addParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
Add the contents of the provided map to the map of module parameters.
|
ModuleDescriptor |
build()
Return a new instance of
ModuleDescriptor . |
static ModuleDescriptor.Builder |
fromModuleDescriptor(ModuleDescriptor descriptor)
Create a
Builder object pre-populated with the configuration
for the provided ModuleDescriptor . |
java.lang.String |
getGroup()
Return name of deployable unit this module instance belongs to
(such as a stream or job).
|
int |
getIndex()
Return position in stream/job definition relative to the other modules in
the definition.
|
ModuleDefinition |
getModuleDefinition() |
java.lang.String |
getModuleLabel()
Return symbolic name of a module.
|
java.lang.String |
getModuleName()
Return name of module.
|
java.util.Map<java.lang.String,java.lang.String> |
getParameters()
Return parameters for module.
|
java.lang.String |
getSinkChannelName()
Return name of sink channel, if defined by the stream/job definition.
|
java.lang.String |
getSourceChannelName()
Return name of source channel, if defined by the stream/job definition.
|
ModuleType |
getType()
Return the module type.
|
ModuleDescriptor.Builder |
setGroup(java.lang.String group)
Set the module group.
|
ModuleDescriptor.Builder |
setIndex(int index)
Set the module index.
|
ModuleDescriptor.Builder |
setModuleDefinition(ModuleDefinition moduleDefinition) |
ModuleDescriptor.Builder |
setModuleLabel(java.lang.String moduleLabel)
Set the module label.
|
ModuleDescriptor.Builder |
setModuleName(java.lang.String moduleName)
Set the module name.
|
ModuleDescriptor.Builder |
setParameter(java.lang.String name,
java.lang.String value)
Set a module parameter.
|
ModuleDescriptor.Builder |
setSinkChannelName(java.lang.String sinkChannelName)
Set the module sink channel name.
|
ModuleDescriptor.Builder |
setSourceChannelName(java.lang.String sourceChannelName)
Set the module source channel name.
|
ModuleDescriptor.Builder |
setType(ModuleType type)
Set the module type.
|
public ModuleDescriptor.Builder setModuleName(java.lang.String moduleName)
moduleName
- name of moduleModuleDescriptor.getModuleName()
public ModuleDescriptor.Builder setModuleLabel(java.lang.String moduleLabel)
moduleLabel
- name of module labelModuleDescriptor.moduleLabel
public ModuleDescriptor.Builder setGroup(java.lang.String group)
group
- name of module groupModuleDescriptor.group
public ModuleDescriptor.Builder setSourceChannelName(java.lang.String sourceChannelName)
sourceChannelName
- name of source channel; may be null
ModuleDescriptor.sourceChannelName
public ModuleDescriptor.Builder setSinkChannelName(java.lang.String sinkChannelName)
sinkChannelName
- name of sink channel; may be null
ModuleDescriptor.sinkChannelName
public ModuleDescriptor.Builder setIndex(int index)
index
- position of module in stream/job definitionModuleDescriptor.index
public ModuleDescriptor.Builder setType(ModuleType type)
type
- module typeModuleDescriptor.getType()
public ModuleDescriptor.Builder addChildren(java.util.List<ModuleDescriptor> children)
children
- sub modulesModuleDescriptor.children
public ModuleDescriptor.Builder setParameter(java.lang.String name, java.lang.String value)
name
- parameter namevalue
- parameter valueModuleDescriptor.parameters
public ModuleDescriptor.Builder addParameters(java.util.Map<java.lang.String,java.lang.String> parameters)
parameters
- module parametersModuleDescriptor.parameters
public java.lang.String getModuleName()
$XD_HOME/modules/[module type]
.public java.lang.String getModuleLabel()
public java.lang.String getGroup()
public java.lang.String getSourceChannelName()
null
.null
if no source channel definedpublic java.lang.String getSinkChannelName()
null
.null
if no sink channel definedpublic int getIndex()
public ModuleType getType()
public java.util.Map<java.lang.String,java.lang.String> getParameters()
public static ModuleDescriptor.Builder fromModuleDescriptor(ModuleDescriptor descriptor)
Builder
object pre-populated with the configuration
for the provided ModuleDescriptor
.descriptor
- module descriptorpublic ModuleDescriptor build()
ModuleDescriptor
.ModuleDescriptor
public ModuleDescriptor.Builder setModuleDefinition(ModuleDefinition moduleDefinition)
public ModuleDefinition getModuleDefinition()