package de.siphalor.was.content.product;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Random;

/**
 * Interface for product types.
 * @param <T> The base class vor all products of this type
 */
public interface ProductType<T extends Product> {

	/**
	 * Gets a product of this type with the given values as properties.
	 * @param values Some properties
	 * @return The product or <code>null</code> if no such product exists
	 */
	@Nullable T getProduct(@NotNull String[] values);

	/**
	 * Gets the id of this type.
	 * @return The id
	 */
	@NotNull String getId();

	/**
	 * Gets all property ids.
	 * @return An array of the property ids
	 */
	@NotNull String[] getProperties();

	/**
	 * Gets a random product of this type.
	 * @param random The random instance to use
	 * @return A random product
	 */
	@NotNull T randomProduct(Random random);
}
