Map

private Map fields = new HashMap<>();

for (Map.Entry entry : Param.getFields().entrySet()) {

            Long count = entry.getValue();

            switch (entry.getKey()) {
                case A:
                    aram.setBQuantity(count);
                    break;
                case B:
                    aram.setAQuantity(count);
                    break;
            }
        }

你可能感兴趣的:(Map)