I wish to convert a Color Object into a human readable String.
To clarify I’m just looking for a conversion of the Class’s static variables.
eg.
- Color.YELLOW -> “yellow”
- Color.RED -> “red”
Color red = Color.RED;
System.out.println(red.conversionMethod());
I want an output of “red”
Thank you in advance for your help.
Get use of Java reflection. This code gives useful output. You can remove unwanted ones from ArrayList via something like
list.remove("BITMASK");Output: