private Map<Object, Object> filterBlockOptions( StructuralNode parent, Map<Object, Object> options, String... optionNames) { final Map<Object, Object> copy = new HashMap<>(options); final Ruby ruby = JRubyRuntimeContext.get(parent); for (String optionName : optionNames) { final Object optionValue = copy.get(optionName); if (optionValue != null) { if (optionValue instanceof String) { copy.put(optionName, getRubySymbol(ruby, (String) optionValue)); } else if (optionValue instanceof List) { List valueList = (List) optionValue; List newValueList = new ArrayList(valueList.size()); for (Object v : valueList) { if (v instanceof String) { newValueList.add(getRubySymbol(ruby, (String) v)); } else { newValueList.add(v); } } copy.put(optionName, newValueList); } } } return copy; }
private Map<Object, Object> filterBlockOptions( StructuralNode parent, Map<Object, Object> options, String... optionNames) { final Map<Object, Object> copy = new HashMap<>(options); final Ruby ruby = JRubyRuntimeContext.get(parent); for (String optionName : optionNames) { final Object optionValue = copy.get(optionName); if (optionValue != null) { if (optionValue instanceof String) { copy.put(optionName, getRubySymbol(ruby, (String) optionValue)); } else if (optionValue instanceof List) { List valueList = (List) optionValue; List newValueList = new ArrayList(valueList.size()); for (Object v : valueList) { if (v instanceof String) { newValueList.add(getRubySymbol(ruby, (String) v)); } else { newValueList.add(v); } } copy.put(optionName, newValueList); } } } return copy; }