I have an enum
with another enum
as a parameter
public enum MyEntity{
Entity1(EntityType.type1,
....
MyEntity(EntityType ty
public enum FibreSpeed {
a30M( "30Mb Fibre Connection - Broadband Only", 100 ),
a150M( "150Mb Fibre Connection - Broadband Only", 300 ),
a1G( "1Gb Fibre Connection - Broadband Only", 500 ),
b30M( "30Mb Fibre Connection - Broadband & Phone", 700 ),
b150M( "150Mb Fibre Connection - Broadband & Phone", 900 ),
b1G( "1Gb Fibre Connection - Broadband & Phone", 1000 );
public String speed;
public int weight;
FibreSpeed(String speed, int weight) {
this.speed = speed;
this.weight = weight;
}
public static Map SPEEDS = Stream.of( values() ).collect( Collectors.toMap( k -> k.speed, v -> v.weight ) );
}