package p.studio.compiler.source.tables;

import java.util.Objects;

public record HostBindingRef(
        String module,
        String name,
        long version) {
    public HostBindingRef {
        module = Objects.requireNonNull(module, "module");
        name = Objects.requireNonNull(name, "name");
        if (module.isBlank() || name.isBlank()) {
            throw new IllegalArgumentException("module and name must not be blank");
        }
        if (version < 0) {
            throw new IllegalArgumentException("version must be non-negative");
        }
    }
}
