/** * Creates an instance of {@link WeightPair}. This is a helper method that is useful for following methods:<br> * {@link #weighted(WeightPair...)}<br> * {@link #weighted(List)}<br> * * @param value The value. * @param weight Represents distribution weight of this value. * @param <T> Type of value weight pair contains. * @return An instance of {@link CountPair}. */ public static <T> WeightPair<T> weightPair(T value, double weight) { return new WeightPair<>(value(value), weight); }
/** * Creates an instance of {@link WeightPair}. This is a helper method that is useful for following methods:<br> * {@link #weighted(WeightPair...)}<br> * {@link #weighted(List)}<br> * * @param value The value. * @param weight Represents distribution weight of this value. * @param <T> Type of value weight pair contains. * @return An instance of {@link CountPair}. */ public static <T> WeightPair<T> weightPair(T value, double weight) { return new WeightPair<>(value(value), weight); }