public enum MyEnum { VALUE1(0.2), VALUE2(0.3), VALUE3(0.5); private double probability; MyEnum(double probability) { this.probability = probability; } public static MyEnum getRandomValue() { double random = Math.random(); double cumulativeProbability = 0.0; for (MyEnum value : values()) { cumulativeProbability += value.probability; if (random <= cumulativeProbability) { return value; } } return null; // should never happen } } // Usage: MyEnum randomValue = MyEnum.getRandomValue();