package ru.kirillius.pf.sdn.flow;

import ru.kirillius.pf.sdn.api.flow.FlowFunction;
import ru.kirillius.pf.sdn.api.properties.PropertyDescriptor;

import java.util.Collections;
import java.util.List;
import java.util.Map;

abstract class CommonFunction implements FlowFunction {

    @Override
    public final int getInputCount() {
        return getInputNames().size();
    }

    @Override
    public final int getOutputCount() {
        return getOutputNames().size();
    }

    @Override
    public Map<String, PropertyDescriptor> getProperties() {
        return Collections.emptyMap();
    }

    @Override
    public final boolean hasInputs() {
        return !getInputNames().isEmpty();
    }

    @Override
    public final boolean hasOutputs() {
        return !getOutputNames().isEmpty();
    }

    @Override
    public List<String> getInputNames() {
        return Collections.emptyList();
    }

    @Override
    public List<String> getOutputNames() {
        return Collections.emptyList();
    }
}
