public static class OperatorDescription.Builder extends Object
OperatorDescription
.Constructor and Description |
---|
Builder(Class<? extends Annotation> annotationType)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
OperatorDescription.Builder |
addAttribute(FlowElementAttribute attribute)
Adds an attribute.
|
OperatorDescription.Builder |
addInput(String portName,
Source<?> typeReference)
Adds a new input port of the target operator.
|
OperatorDescription.Builder |
addInput(String portName,
Source<?> typeReference,
ShuffleKey key)
Adds a new input port of the target operator.
|
OperatorDescription.Builder |
addInput(String portName,
Type dataType)
Adds a new input port of the target operator.
|
OperatorDescription.Builder |
addInput(String portName,
Type dataType,
ShuffleKey key)
Adds a new input port of the target operator.
|
OperatorDescription.Builder |
addOutput(String portName,
Source<?> typeReference)
Adds a new output port of the target operator.
|
OperatorDescription.Builder |
addOutput(String portName,
Type dataType)
Adds a new output port of the target operator.
|
OperatorDescription.Builder |
addParameter(String parameterName,
Type parameterType,
Object argument)
Adds a new user parameter.
|
OperatorDescription.Builder |
addPort(FlowElementPortDescription description)
Adds a new port of the target operator.
|
OperatorDescription.Builder |
addResource(FlowResourceDescription resource)
Adds a new external resource.
|
OperatorDescription.Builder |
declare(Class<?> operatorClass,
Class<?> implementorClass,
String methodName)
Sets information of operator method declaration.
|
OperatorDescription.Builder |
declareParameter(Class<?> parameterType)
Adds a parameter of the target operator method.
|
void |
setOrigin(FlowElementDescription origin)
Sets the original description for the building description.
|
OperatorDescription |
toDescription()
Creates a new description object from the previously information.
|
FlowElementResolver |
toResolver()
Creates a new
FlowElementResolver object from the previously information. |
public Builder(Class<? extends Annotation> annotationType)
annotationType
- the operator annotation typeIllegalArgumentException
- if the parameter is null
public OperatorDescription.Builder declare(Class<?> operatorClass, Class<?> implementorClass, String methodName)
declareParameter(Class)
to add method parameters.operatorClass
- the operator classimplementorClass
- the implementation classmethodName
- the operator method nameIllegalArgumentException
- if some parameters are null
public void setOrigin(FlowElementDescription origin)
origin
- the original description, or null
if the building one is the originpublic OperatorDescription.Builder declareParameter(Class<?> parameterType)
parameterType
- the erased parameter typeIllegalArgumentException
- if the parameter is null
public OperatorDescription.Builder addPort(FlowElementPortDescription description)
description
- the port descriptionpublic OperatorDescription.Builder addInput(String portName, Type dataType)
portName
- the port namedataType
- the data typeIllegalArgumentException
- if some parameters are null
public OperatorDescription.Builder addInput(String portName, Source<?> typeReference)
portName
- the port nametypeReference
- a source that has the data type as same to the creating portIllegalArgumentException
- if some parameters are null
public OperatorDescription.Builder addInput(String portName, Type dataType, ShuffleKey key)
portName
- the port namedataType
- the data typekey
- information of the shuffle operationIllegalArgumentException
- if some parameters are null
public OperatorDescription.Builder addInput(String portName, Source<?> typeReference, ShuffleKey key)
portName
- the port nametypeReference
- a source that has the data type as same to the creating portkey
- information of the shuffle operationIllegalArgumentException
- if some parameters are null
public OperatorDescription.Builder addOutput(String portName, Type dataType)
portName
- the port namedataType
- the data typeIllegalArgumentException
- if some parameters are null
public OperatorDescription.Builder addOutput(String portName, Source<?> typeReference)
portName
- the port nametypeReference
- a source that has the data type as same to the creating portIllegalArgumentException
- if some parameters are null
public OperatorDescription.Builder addResource(FlowResourceDescription resource)
resource
- the external resourceIllegalArgumentException
- if the parameter is null
public OperatorDescription.Builder addParameter(String parameterName, Type parameterType, Object argument)
parameterName
- the parameter nameparameterType
- the parameter valueargument
- the actual parameter argument, or null
if the argument is just null
IllegalArgumentException
- if some parameters are null
public OperatorDescription.Builder addAttribute(FlowElementAttribute attribute)
attribute
- the attributeIllegalArgumentException
- if the parameter is null
public OperatorDescription toDescription()
public FlowElementResolver toResolver()
FlowElementResolver
object from the previously information.Copyright © 2011–2019 Asakusa Framework Team. All rights reserved.