Int2ObjectMap<String> (final Class<GridConstraints> aClass, @NonNls final String prefix) { final Int2ObjectMap<String> map = new Int2ObjectOpenHashMap<>(); final Field[] fields = aClass.getFields(); for (final Field field : fields) { if ((field.getModifiers() & Modifier.STATIC) != 0 && field.getName().startsWith(prefix)) { field.setAccessible(true); try { final int value = field.getInt(aClass); map.put(value, aClass.getName() + '.' + field.getName()); } catch (IllegalAccessException e) { throw new RuntimeException(e); } } } return map; }