Source:
public PriorityCalculator(CustomModel customModel, EncodedValueLookup lookup) { for (Map.Entry<String, Object> entry : customModel.getPriority().entrySet()) { String key = entry.getKey(); String priorityKey = "priority." + key; Object value = entry.getValue(); if (value == null) throw new IllegalArgumentException("Missing value for " + key + " in 'priority'"); if (key.startsWith(GeoToValueEntry.AREA_PREFIX)) { if (!(value instanceof Number)) throw new IllegalArgumentException(priorityKey + ": area entry requires number value but was: " + value.getClass().getSimpleName()); Geometry geometry = GeoToValueEntry.pickGeometry(customModel, key); priorityList.add(GeoToValueEntry.create(priorityKey, new PreparedGeometryFactory().create(geometry), (Number) value, 1, 0, 1)); } else { if (!(value instanceof Map)) throw new IllegalArgumentException(priorityKey + ": non-root entries requires a map but was: " + value.getClass().getSimpleName()); EncodedValue encodedValue = getEV(lookup, "priority", key); if (encodedValue instanceof EnumEncodedValue) { priorityList.add(EnumToValueEntry.create(priorityKey, (EnumEncodedValue) encodedValue, (Map) value, 1, 0, 1)); } else if (encodedValue instanceof DecimalEncodedValue) { priorityList.add(DecimalToValueEntry.create(priorityKey, (DecimalEncodedValue) encodedValue, (Map) value, 1, 0, 1)); } else if (encodedValue instanceof BooleanEncodedValue) { priorityList.add(BooleanToValueEntry.create(priorityKey, (BooleanEncodedValue) encodedValue, (Map) value, 1, 0, 1)); } else if (encodedValue instanceof IntEncodedValue) { } else { throw new IllegalArgumentException("encoded value class '" + encodedValue.getClass().getSimpleName() + "' not supported. For '" + key + "' specified in 'priority'."); } } } }

Target:
public PriorityCalculator(CustomModel customModel, EncodedValueLookup lookup) { for (Map.Entry<String, Object> entry : customModel.getPriority().entrySet()) { String key = entry.getKey(); String priorityKey = "priority." + key; Object value = entry.getValue(); if (value == null) throw new IllegalArgumentException("Missing value for " + key + " in 'priority'"); if (key.startsWith(GeoToValueEntry.AREA_PREFIX)) { if (!(value instanceof Number)) throw new IllegalArgumentException(priorityKey + ": area entry requires number value but was: " + value.getClass().getSimpleName()); Geometry geometry = GeoToValueEntry.pickGeometry(customModel, key); priorityList.add(GeoToValueEntry.create(priorityKey, new PreparedGeometryFactory().create(geometry), (Number) value, 1, 0, 1)); } else { if (!(value instanceof Map)) throw new IllegalArgumentException(priorityKey + ": non-root entries requires a map but was: " + value.getClass().getSimpleName()); final double defaultPriority = 1, minPriority = 0, maxPriority = 1; EncodedValue encodedValue = getEV(lookup, "priority", key); if (encodedValue instanceof EnumEncodedValue) { priorityList.add(EnumToValueEntry.create(priorityKey, (EnumEncodedValue) encodedValue, (Map) value, defaultPriority, minPriority, maxPriority)); } else if (encodedValue instanceof DecimalEncodedValue) { priorityList.add(DecimalToValueEntry.create(priorityKey, (DecimalEncodedValue) encodedValue, (Map) value, defaultPriority, minPriority, maxPriority)); } else if (encodedValue instanceof BooleanEncodedValue) { priorityList.add(BooleanToValueEntry.create(priorityKey, (BooleanEncodedValue) encodedValue, (Map) value, defaultPriority, minPriority, maxPriority)); } else if (encodedValue instanceof IntEncodedValue) { } else { throw new IllegalArgumentException("The encoded value '" + key + "' used in 'priority' is of type " + encodedValue.getClass().getSimpleName() + ", but only types enum, decimal and boolean are supported."); } } } }