package p.packer.models;

import java.nio.file.Path;
import java.util.Objects;
import java.util.Optional;

public record PackerRuntimeAsset(
        Path assetRoot,
        Path manifestPath,
        Optional<PackerRegistryEntry> registryEntry,
        PackerAssetDeclarationParseResult parsedDeclaration) {

    public PackerRuntimeAsset {
        assetRoot = Objects.requireNonNull(assetRoot, "assetRoot").toAbsolutePath().normalize();
        manifestPath = Objects.requireNonNull(manifestPath, "manifestPath").toAbsolutePath().normalize();
        registryEntry = Objects.requireNonNull(registryEntry, "registryEntry");
        parsedDeclaration = Objects.requireNonNull(parsedDeclaration, "parsedDeclaration");
    }
}
