public enum Cities {
Moscow(45), Novosibirsk(50);
private int regionCode;
Cities(int regionCode)
{
this.regionCode = regionCode;
}
}
Class<?> clazz = Cities.class;
for(var c: clazz.getDeclaredConstructors())
{
System.out.println(c.toGenericString());
}
/*
* Decompiled with CFR 0.151.
*/
package com.learning.enums;
public final class City
extends Enum<City> {
public static final /* enum */ City Moscow = new City("Moscow", 0, 45);
public static final /* enum */ City Novosibirsk = new City("Novosibirsk", 1, 50);
private int regionCode;
private static final /* synthetic */ City[] $VALUES;
public static City[] values() {
return (City[])$VALUES.clone();
}
public static City valueOf(String name) {
return Enum.valueOf(City.class, name);
}
private City(String string, int n, int regionCode) {
super(string, n);
this.regionCode = regionCode;
}
private static /* synthetic */ City[] $values() {
return new City[]{Moscow, Novosibirsk};
}
static {
$VALUES = City.$values();
}
}
private Cities(int)
enum Cities {
Moscow(45),
Novosibirsk(50);
private int regionCode;
Cities(int regionCode)
{
this.regionCode = regionCode;
}
}
class Main {
public static void main(String[] args) {
Class<?> clazz = Cities.class;
for(var c: clazz.getDeclaredConstructors())
{
System.out.println(c.toGenericString());
}
}
}