package p.packer.models;

import java.util.Objects;
import java.util.function.Predicate;

public record PackerRuntimeMaterializationConfig(
        PackerWalkMode mode,
        Predicate<PackerProbeResult> projectionFilter) {

    public PackerRuntimeMaterializationConfig {
        mode = Objects.requireNonNull(mode, "mode");
        projectionFilter = Objects.requireNonNull(projectionFilter, "projectionFilter");
    }

    public static PackerRuntimeMaterializationConfig runtimeDefault() {
        return new PackerRuntimeMaterializationConfig(PackerWalkMode.RUNTIME, probe -> true);
    }

    public static PackerRuntimeMaterializationConfig packingBuild() {
        return new PackerRuntimeMaterializationConfig(PackerWalkMode.PACKING, probe -> true);
    }
}
