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.
 Item one = new Item();
 Item two = new Item();
 Item three = new Item();

 ItemRandomizer<Object> randomizer = ItemRandomizer.randomizer(Arrays.asList(one, two, three));

 randomizer.setWeight(one, 10);
 randomizer.setWeight(two, 60);
 randomizer.setWeight(three, 30);

 //10% chance of getting 'one', 60% chance of getting 'two' and 30% chance of getting 'three'.
 Item random = randomizer.get().orElse(null);
For instances use the following factory functions: randomizer(Collection)