@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.Builder unitConfig = entry.getMessage().toBuilder(); UnitConfigProcessor.verifyUnit(unitConfig.build()); switch (unitConfig.getType()) { case APP: if (!unitConfig.getAppConfig().hasAutostart()) { unitConfig.getAppConfigBuilder().setAutostart(DEFAULT_AUTOSTART_STATE); throw new EntryModification(entry.setMessage(unitConfig), this); } break; case AGENT: if (!unitConfig.getAgentConfig().hasAutostart()) { unitConfig.getAgentConfigBuilder().setAutostart(DEFAULT_AUTOSTART_STATE); throw new EntryModification(entry.setMessage(unitConfig), this); } break; default: throw new NotSupportedException(unitConfig.getType(), getClass()); } } }