package org.toop.framework.resource.types;

import org.toop.framework.resource.ResourceLoader;

/**
 * Marker interface for resources that should be **automatically loaded** by the {@link
 * ResourceLoader}.
 *
 * <p>Extends {@link LoadableResource}, so any implementing class must provide the standard {@link
 * LoadableResource#load()} and {@link LoadableResource#unload()} methods, as well as the {@link
 * LoadableResource#isLoaded()} check.
 *
 * <p>When a resource implements {@code PreloadResource}, the {@code ResourceLoader} will invoke
 * {@link LoadableResource#load()} automatically after the resource is discovered and instantiated,
 * without requiring manual loading by the user.
 *
 * <p>Typical usage:
 *
 * <pre>{@code
 * public class MyFontAsset extends BaseResource implements PreloadResource {
 *     @Override
 *     public void load() {
 *         // load the font into memory
 *     }
 *
 *     @Override
 *     public void unload() {
 *         // release resources if needed
 *     }
 *
 *     @Override
 *     public boolean isLoaded() {
 *         return loaded;
 *     }
 * }
 * }</pre>
 *
 * <p>Note: Only use this interface for resources that are safe to load at startup, as it may
 * increase memory usage or startup time.
 */
public interface PreloadResource extends LoadableResource {}
