package de.siphalor.was.content.resource;

import org.jetbrains.annotations.Nullable;

import java.io.InputStream;
import java.util.function.Supplier;

public class CallbackResource extends Resource {
	Supplier<InputStream> supplier;

	public CallbackResource(String id, Supplier<InputStream> supplier) {
		super(id);
		this.supplier = supplier;
	}

	@Override
	public @Nullable InputStream getInputStream() {
		return supplier.get();
	}
}
