Interface ItemRandomizer<T>

Type Parameters:
T - the type of item this random item model returns

public interface ItemRandomizer<T>
ItemRandomizer provides a way to randomly choose an item based on a weight value.
String one = "one";
String two = "two";
String three = "three";

ItemRandomizer<String> randomizer = ItemRandomizer.randomizer(List.of(
				randomItem(one, 10),
				randomItem(two, 60),
				randomItem(three, 30)));

//10% chance of getting 'one', 60% chance of getting 'two' and 30% chance of getting 'three'.
String random = randomizer.get().orElse(null);

// The weights can be changed
randomizer.weight(one).set(20);
For instances use the following factory functions: randomizer(Collection)