package ru.kirillius.pf.sdn.flow;

import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import ru.kirillius.pf.sdn.api.flow.CallContext;

import java.util.List;

@Slf4j
@RequiredArgsConstructor
public class DebugOutput extends CommonFunction {
    private final ObjectMapper objectMapper;

    @Override
    public void apply(CallContext context) {
        log.info(objectMapper.valueToTree(context.getSources()).toString());
    }

    @Override
    public List<String> getInputNames() {
        return List.of("input");
    }

}
