<commit_before>package io.github.factoryfx.docu.update;

import io.github.factoryfx.factory.attribute.types.StringAttribute;
import io.github.factoryfx.factory.FactoryBase;


public class RootFactory extends FactoryBase<Root, RootFactory> {
    public final StringAttribute stringAttribute = new StringAttribute();

    public RootFactory(){
        configLifeCycle().setCreator(() ->  new Root(stringAttribute.get()));
        configLifeCycle().setStarter(root -> {
            //artificial long start time
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
        });
        configLifeCycle().setUpdater(root -> root.setDummy(stringAttribute.get()));<commit_msg>extend example<commit_after>package io.github.factoryfx.docu.update;

import io.github.factoryfx.factory.FactoryBase;
import io.github.factoryfx.factory.attribute.types.StringAttribute;

public class RootFactory extends FactoryBase<Root, RootFactory> {
    public final StringAttribute stringAttribute = new StringAttribute();

    public RootFactory() {
        configLifeCycle().setCreator(() -> new Root(stringAttribute.get()));
        configLifeCycle().setStarter(root -> {
            //artificial long start time
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                Thread.currentThread().interrupt();
            }
        });
        configLifeCycle().setUpdater(root -> root.setDummy(stringAttribute.get()));

        // You can also conditionally recreate the expensive resource
        //configLifeCycle().setReCreator(root -> {
        //    if (stringAttribute.get().equals("someCondition")) {
        //        return new Root(stringAttribute.get());
        //    } else {
        //        root.setDummy(stringAttribute.get());
        //        return root;
        //    }
        //});
{'fraction_non_alphanumeric': 0.11993849308047155, 'fraction_numerical': 0.004100461301896463, 'mean_word_length': 2.4919499105545615, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '4441847', 'n_tokens_mistral': 501, 'n_tokens_neox': 489, 'n_words': 90}