package ru.kirillius.pf.sdn.pipeline;

import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import ru.kirillius.pf.sdn.api.Networking.NetworkScope;
import ru.kirillius.pf.sdn.api.pipeline.PipelineFunction;
import ru.kirillius.pf.sdn.api.properties.PropertyDescriptor;

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

@Slf4j
@RequiredArgsConstructor
public class DebugOutput implements PipelineFunction {
    private final ObjectMapper objectMapper;

    @Override
    public NetworkScope apply(NetworkScope source, Map<String, String> properties) {
        log.info(objectMapper.valueToTree(source).toString());
        return source;
    }

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

}
