@Override public void processData(String id, IdentifiableMessage<String, UnitConfig, UnitConfig.Builder> entry, ProtoBufMessageMap<String, UnitConfig, UnitConfig.Builder> entryMap, ProtoBufRegistry<String, UnitConfig, UnitConfig.Builder> registry) throws CouldNotPerformException, EntryModification { UnitConfig locationUnitConfig = entry.getMessage(); for (String childLocationId : new ArrayList<>(locationUnitConfig.getLocationConfig().getChildIdList())) { UnitConfig childLocationUnitConfig = registry.getMessage(childLocationId); if (labelConsistencyMap.containsKey(childLocationUnitConfig.getLabel()) && !labelConsistencyMap.get(childLocationUnitConfig.getLabel()).equals(childLocationId)) { throw new InvalidStateException("Location [" + locationUnitConfig.getId() + "," + locationUnitConfig.getLabel() + "] has more than on child with the same label [" + childLocationUnitConfig.getLabel() + "]"); } else { labelConsistencyMap.put(childLocationUnitConfig.getLabel(), childLocationId); } } }
childLocationConfig = registry.getMessage(childLocationId);
case REGION: parent = registry.getMessage(locationUnit.getPlacementConfig().getLocationId()); if (parent.getLocationConfig().getType() == LocationType.ZONE) { throw new CouldNotPerformException("Parent[" + parent.getLabel() + "] of region[" + locationUnit.getLabel() + "]" child = registry.getMessage(childId); if (child.getLocationConfig().getType() != LocationType.REGION) { throw new CouldNotPerformException("Child[" + child.getLabel() + "] of region[" + locationUnit.getLabel() + "]" case TILE: parent = registry.getMessage(locationUnit.getPlacementConfig().getLocationId()); if (parent.getLocationConfig().getType() != LocationType.ZONE) { throw new CouldNotPerformException("Parent[" + parent.getLabel() + "] of tile[" + locationUnit.getLabel() + "]" child = registry.getMessage(childId); if (child.getLocationConfig().getType() != LocationType.REGION) { throw new CouldNotPerformException("Child[" + child.getLabel() + "] of tile[" + locationUnit.getLabel() + "]" parent = registry.getMessage(locationUnit.getPlacementConfig().getLocationId()); if (parent.getLocationConfig().getType() != LocationType.ZONE) { throw new CouldNotPerformException("Parent[" + parent.getLabel() + "] of zone[" + locationUnit.getLabel() + "]" child = registry.getMessage(childId); if (child.getLocationConfig().getType() == LocationType.REGION) { throw new CouldNotPerformException("Child[" + child.getLabel() + "] of zone[" + locationUnit.getLabel() + "]"