<commit_before>package de.omnikryptec.core;

import com.google.common.collect.Multimap;
import com.google.common.collect.MultimapBuilder;
import de.omnikryptec.util.Util;
import de.omnikryptec.util.updater.Time;

public class UpdateContainer implements Updateable {
    
    public enum UpdateType {
        PRE,
        MAIN,
        POST
    }
    
    private final Multimap<UpdateType, Updateable> updateables;
    
    public UpdateContainer() {
        updateables = MultimapBuilder.enumKeys(UpdateType.class).arrayListValues().build();
    }
    
    public Multimap<UpdateType, Updateable> getUpdateables() {
        return updateables;
    }
    
    public UpdateContainer addUpdateable(Updateable updateable, UpdateType... updateTypes) {
        Util.ensureNonNull(updateable);
        if (updateable == this) {
            throw new IllegalArgumentException("Can't add this");
        }
        if (updateTypes == null || updateTypes.length == 0) {
            updateTypes = UpdateType.values();
        }
        for (UpdateType updateType : updateTypes) {
            updateables.put(updateType, updateable);
        }
        return this;
    }
    
    @Override
    public void preUpdate(Time time) {
        for (Updateable updateable : updateables.get(UpdateType.PRE)) {
            updateable.preUpdate(time);
        }
    }
    
    @Override
    public void update(Time time) {
        for (Updateable updateable : updateables.get(UpdateType.MAIN)) {
            updateable.update(time);
        }
    }
    
    @Override
    public void postUpdate(Time time) {
        for (Updateable updateable : updateables.get(UpdateType.POST)) {
            updateable.postUpdate(time);
        }
    }
    
}<commit_msg>simpler UpdateContainer<commit_after>package de.omnikryptec.core;

import java.util.ArrayList;
import java.util.List;

import de.omnikryptec.util.Util;
import de.omnikryptec.util.updater.Time;

public class UpdateContainer implements Updateable {

    private final List<Updateable> updateables;

    public UpdateContainer() {
        updateables = new ArrayList<>();
    }

    public UpdateContainer addUpdateable(Updateable updateable) {
        Util.ensureNonNull(updateable);
        if (updateable == this) {
            throw new IllegalArgumentException("Can't add this");
        }
        updateables.add(updateable);
        return this;
    }

    @Override
    public void preUpdate(Time time) {
        for (Updateable updateable : updateables) {
            updateable.preUpdate(time);
        }
    }

    @Override
    public void update(Time time) {
        for (Updateable updateable : updateables) {
            updateable.update(time);
        }
    }

    @Override
    public void postUpdate(Time time) {
        for (Updateable updateable : updateables) {
            updateable.postUpdate(time);
        }
    }

}
{'fraction_non_alphanumeric': 0.09290187891440502, 'fraction_numerical': 0.0003479471120389701, 'mean_word_length': 2.4348864994026282, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7554443', 'n_tokens_mistral': 808, 'n_tokens_neox': 792, 'n_words': 167}