package javaflow.network.definer;
import javaflow.components.api.Component;
import javaflow.network.api.ClassComponentDefinition;
import javaflow.network.api.ComponentDefinitionVisitor;
import javaflow.network.api.PortReference;
final class ClassComponentDef extends ComponentDef implements ClassComponentDefinition{
private final Class<? extends Component> componentClass;
public ClassComponentDef(String componentName, Class<? extends Component> componentClass) {
super(componentName);
this.componentClass = componentClass;
}
public PortReference port(String portName) {
return new PortReference(name(), portName);
}
@Override
public void accept(ComponentDefinitionVisitor visitor) {
visitor.visit(this);
}
public Class<? extends Component> componentClass() {
return componentClass;
}
public PortReference port(String portName, int i) {
return new PortReference(name(), portName, i);
}
}