I am struggling to have a proper implementation in java when it is required to have a set of constants values in String and those strings have the values again in integer/String. for example,
- small-diesel-car : 142g
- small-petrol-car : 154g
- small-plugin-hybrid-car : 73g
- small-electric-car : 50g
So, I have defined those Strings literals in Constants.java like:
public static final String SMALL_DIESEL_CAR = "small-diesel-car";
But now "small-diesel-car" should have a value of 142.
My question is: How should I be handling this scenario using constants and enum classes or anything else?