<commit_before>/*
 * Copyright 2015, Teradata, Inc. All rights reserved.
 */

package com.teradata.test.fulfillment.table;

import com.teradata.test.Requirement;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.teradata.test.fulfillment.table.MutableTableRequirement.State.LOADED;
import static org.apache.commons.lang3.builder.EqualsBuilder.reflectionEquals;
import static org.apache.commons.lang3.builder.HashCodeBuilder.reflectionHashCode;

public class MutableTableRequirement
        implements Requirement
{
    public enum State
    {
        CREATED,
        LOADED
    }

    private final TableDefinition tableDefinition;
    private final String name;
    private final State state;

    public MutableTableRequirement(TableDefinition tableDefinition)
    {
        this(tableDefinition, tableDefinition.getName(), LOADED);
    }

    public MutableTableRequirement(TableDefinition tableDefinition, String name, State state)
    {
        this.tableDefinition = checkNotNull(tableDefinition);
        this.name = checkNotNull(name);
        this.state = checkNotNull(state);
    }

    public TableDefinition getTableDefinition()
    {
        return tableDefinition;
    }

    public String getName()
    {
        return name;
    }

    public State getState()
    {
        return state;
    }

    @Override
    public boolean equals(Object o)
    {
        return reflectionEquals(this, o);
    }

    @Override
    public int hashCode()
    {
        return reflectionHashCode(this);
    }

    public static MutableTableRequirementBuilder builder(TableDefinition tableDefinition)
    {
        return new MutableTableRequirementBuilder(tableDefinition);
    }

    public static class MutableTableRequirementBuilder
    {
        private final TableDefinition tableDefinition;
        private String name;
        private State state;

        public MutableTableRequirementBuilder(TableDefinition tableDefinition)
        {
            this.tableDefinition = tableDefinition;
        }

        public MutableTableRequirementBuilder withName(String name)
        {
            this.name = name;
            return this;
        }

        public MutableTableRequirementBuilder withState(State state)
        {
            this.state = state;
            return this;
        }

        public MutableTableRequirement build()
        {
            return new MutableTableRequirement(tableDefinition, name, state);<commit_msg>test-framework: take default name from table definition<commit_after>/*
 * Copyright 2015, Teradata, Inc. All rights reserved.
 */

package com.teradata.test.fulfillment.table;

import com.teradata.test.Requirement;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.teradata.test.fulfillment.table.MutableTableRequirement.State.LOADED;
import static org.apache.commons.lang3.builder.EqualsBuilder.reflectionEquals;
import static org.apache.commons.lang3.builder.HashCodeBuilder.reflectionHashCode;

public class MutableTableRequirement
        implements Requirement
{
    public enum State
    {
        CREATED,
        LOADED
    }

    private final TableDefinition tableDefinition;
    private final String name;
    private final State state;

    public MutableTableRequirement(TableDefinition tableDefinition)
    {
        this(tableDefinition, tableDefinition.getName(), LOADED);
    }

    public MutableTableRequirement(TableDefinition tableDefinition, String name, State state)
    {
        this.tableDefinition = checkNotNull(tableDefinition);
        this.name = checkNotNull(name);
        this.state = checkNotNull(state);
    }

    public TableDefinition getTableDefinition()
    {
        return tableDefinition;
    }

    public String getName()
    {
        return name;
    }

    public State getState()
    {
        return state;
    }

    @Override
    public boolean equals(Object o)
    {
        return reflectionEquals(this, o);
    }

    @Override
    public int hashCode()
    {
        return reflectionHashCode(this);
    }

    public static MutableTableRequirementBuilder builder(TableDefinition tableDefinition)
    {
        return new MutableTableRequirementBuilder(tableDefinition);
    }

    public static class MutableTableRequirementBuilder
    {
        private final TableDefinition tableDefinition;
        private String name;
        private State state;

        public MutableTableRequirementBuilder(TableDefinition tableDefinition)
        {
            this.tableDefinition = tableDefinition;
            this.name = tableDefinition.getName();
        }

        public MutableTableRequirementBuilder withName(String name)
        {
            this.name = name;
            return this;
        }

        public MutableTableRequirementBuilder withState(State state)
        {
            this.state = state;
            return this;
        }

        public MutableTableRequirement build()
        {
            return new MutableTableRequirement(tableDefinition, name, state);
{'fraction_non_alphanumeric': 0.06609934692262022, 'fraction_numerical': 0.002374826835543242, 'mean_word_length': 2.729889298892989, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1225124', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1244, 'n_words': 297}