<commit_before>package org.lightadmin.core.config.domain.configuration;

import org.lightadmin.api.config.builder.EntityMetadataConfigurationUnitBuilder;
import org.lightadmin.api.config.unit.EntityMetadataConfigurationUnit;
import org.lightadmin.api.config.utils.EntityNameExtractor;
import org.lightadmin.core.config.domain.common.AbstractFieldSetConfigurationBuilder;
import org.lightadmin.core.config.domain.configuration.support.EntityNameExtractorFactory;

public class DefaultEntityMetadataConfigurationUnitBuilder extends AbstractFieldSetConfigurationBuilder<EntityMetadataConfigurationUnit, EntityMetadataConfigurationUnitBuilder>
        implements EntityMetadataConfigurationUnitBuilder {

    private final DefaultEntityMetadataConfigurationUnit configurationUnit;

    public DefaultEntityMetadataConfigurationUnitBuilder(Class<?> domainType) {
        super(domainType);
        configurationUnit = new DefaultEntityMetadataConfigurationUnit(domainType);
        configurationUnit.setSingularName(domainType.getSimpleName());
        configurationUnit.setPluralName(domainType.getSimpleName());
    }

    @Override
    public EntityMetadataConfigurationUnitBuilder nameField(final String nameField) {
        EntityNameExtractor<?> nameExtractor = EntityNameExtractorFactory.forNamedPersistentEntity(nameField);
        configurationUnit.setNameExtractor(nameExtractor);
        return this;
    }

    @Override
    public EntityMetadataConfigurationUnitBuilder nameExtractor(final EntityNameExtractor<?> nameExtractor) {
        configurationUnit.setNameExtractor(nameExtractor);
        return this;
    }

    @Override
    public EntityMetadataConfigurationUnitBuilder singularName(final String singularName) {
        configurationUnit.setSingularName(singularName);
        return this;
    }

    @Override
    public EntityMetadataConfigurationUnitBuilder pluralName(final String pluralName) {
        configurationUnit.setSingularName(pluralName);
        return this;
    }

    @Override
    protected void addCurrentFieldToUnit() {
        if (currentFieldMetadata != null) {
            configurationUnit.addField(currentFieldMetadata);
        }
    }

    @Override
    public EntityMetadataConfigurationUnit build() {
        addCurrentFieldToUnit();
        return configurationUnit;
    }
}
<commit_msg>Small bug-fix<commit_after>package org.lightadmin.core.config.domain.configuration;

import org.lightadmin.api.config.builder.EntityMetadataConfigurationUnitBuilder;
import org.lightadmin.api.config.unit.EntityMetadataConfigurationUnit;
import org.lightadmin.api.config.utils.EntityNameExtractor;
import org.lightadmin.core.config.domain.common.AbstractFieldSetConfigurationBuilder;

import static org.lightadmin.core.config.domain.configuration.support.EntityNameExtractorFactory.forNamedPersistentEntity;

public class DefaultEntityMetadataConfigurationUnitBuilder extends AbstractFieldSetConfigurationBuilder<EntityMetadataConfigurationUnit, EntityMetadataConfigurationUnitBuilder>
        implements EntityMetadataConfigurationUnitBuilder {

    private final DefaultEntityMetadataConfigurationUnit configurationUnit;

    public DefaultEntityMetadataConfigurationUnitBuilder(Class<?> domainType) {
        super(domainType);
        configurationUnit = new DefaultEntityMetadataConfigurationUnit(domainType);
        configurationUnit.setSingularName(domainType.getSimpleName());
        configurationUnit.setPluralName(domainType.getSimpleName());
    }

    @Override
    public EntityMetadataConfigurationUnitBuilder nameField(final String nameField) {
        configurationUnit.setNameExtractor(forNamedPersistentEntity(nameField));
        return this;
    }

    @Override
    public EntityMetadataConfigurationUnitBuilder nameExtractor(final EntityNameExtractor<?> nameExtractor) {
        configurationUnit.setNameExtractor(nameExtractor);
        return this;
    }

    @Override
    public EntityMetadataConfigurationUnitBuilder singularName(final String singularName) {
        configurationUnit.setSingularName(singularName);
        return this;
    }

    @Override
    public EntityMetadataConfigurationUnitBuilder pluralName(final String pluralName) {
        configurationUnit.setPluralName(pluralName);
        return this;
    }

    @Override
    protected void addCurrentFieldToUnit() {
        if (currentFieldMetadata != null) {
            configurationUnit.addField(currentFieldMetadata);
        }
    }

    @Override
    public EntityMetadataConfigurationUnit build() {
        addCurrentFieldToUnit();
        return configurationUnit;
    }
}

{'fraction_non_alphanumeric': 0.0645580589254766, 'fraction_numerical': 0.0, 'mean_word_length': 4.807547169811321, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '383185', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1051, 'n_words': 173}