<commit_before>package cafetcraftteam.rpgsoftware.equipment;

import android.support.annotation.NonNull;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
 * Class of the Weapons
 */
public class Weapon extends Equipment
{
    // the different groups possible for the weapons
    public enum Group
    {
        ORDINARY,
        CAVALRY,
        CROSSBOW,
        ENGINEER,
        ESTANGLING,
        FENCING,
        FLAIL,
        GUNPOWDER,
        LONGBOW,
        PARRYING,
        SLING,
        THROWING,
        TWO_HANDED
    }

    public enum Qualities
    {
        ARMOUR_PIERCING,
        BALANCED,
        DEFENSIVE,
        EXPERIMENTAL,
        FAST,
        IMPACT,
        PRECISE,
        PUMMELLING,
        SHRAPNEL,
        SLOW,
        SNARE,
        SPECIAL,
        TIRING,
        UNRELIABLE
    }

    // The weapon group of the weapon
    private final Group mGroup;

    // the qualities of the weapon
    private final Qualities mQualities;

    /**
     * Constructor of the class weapon
     *
     * @param name        the name of the weapon
     * @param encumbering the encumbering of the weapon
     * @param price       the price of the weapon
     * @param quality     the quality of the weapon
     * @param description the description of the weapon
     * @param group       the group of the weapon
     * @param qualities   the qualities of the weapon
     */
    public Weapon(@NonNull String name, int encumbering, int price, @NonNull Quality quality,
                  @NonNull String description, @NonNull Group group, @NonNull Qualities qualities)
    {
        super(name, encumbering, price, quality, description);
        mGroup = group;
        mQualities = qualities;
    }

    public Group getGroup()
    {
        return mGroup;
    }

    public Qualities getQualities()
    {
        return mQualities;
    }

    @Override
    public boolean equals(Object object)
    {
        if (object == null)
        {
            return false;
        }

        //Verify if it's not the same object
        if (object == this)
        {
            return true;
        }

        if (!(object instanceof Weapon))
        {
            return false;
        }

        Weapon other = (Weapon) object;

        return new EqualsBuilder()
                .appendSuper(super.equals(object))
                .append(mGroup, other.mGroup)
                .append(mQualities, other.mQualities)
                .isEquals();
    }

    @Override
    public int hashCode()
    {
        return new HashCodeBuilder(5, 19)
                .appendSuper(super.hashCode())
                .append(mGroup)
                .append(mQualities)
                .toHashCode();
    }
}<commit_msg>Commentaire de la class Weapon<commit_after>package cafetcraftteam.rpgsoftware.equipment;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

/**
 * Class of the Weapons
 */
public class Weapon extends Equipment
{
    // the different groups possible for the weapons
    public enum Group
    {
        ORDINARY,
        CAVALRY,
        CROSSBOW,
        ENGINEER,
        ESTANGLING,
        FENCING,
        FLAIL,
        GUNPOWDER,
        LONGBOW,
        PARRYING,
        SLING,
        THROWING,
        TWO_HANDED
    }

    public enum Qualities
    {
        ARMOUR_PIERCING,
        BALANCED,
        DEFENSIVE,
        EXPERIMENTAL,
        FAST,
        IMPACT,
        NONE,
        PRECISE,
        PUMMELLING,
        SHRAPNEL,
        SLOW,
        SNARE,
        SPECIAL,
        TIRING,
        UNRELIABLE
    }

    // The weapon group of the weapon
    private final Group mGroup;

    // the qualities of the weapon
    private final Qualities mQualities;

    /**
     * Constructor of the class weapon
     *
     * @param name        the name of the weapon, must not be empty or null
     * @param encumbering the encumbering of the weapon, must be positive or zero
     * @param price       the price of the weapon, must be positive or zero
     * @param quality     the quality of the weapon, must not be null
     * @param description the description of the weapon, if null replace by an empty string
     * @param group       the group of the weapon, must not be null
     * @param qualities   the qualities of the weapon, if null replace by the NONE Qualities
     */
    public Weapon(@NonNull String name, int encumbering, int price, @NonNull Quality quality,
                  @Nullable String description, @NonNull Group group, @Nullable Qualities qualities)
    {
        super(name, encumbering, price, quality, description);

        // verification of the contract of the constructor
        if (group == null)
        {
            throw new IllegalArgumentException("The group of the weapon must not be null");
        }
        if (qualities == null)
        {
            qualities = Qualities.NONE;
        }

        mGroup = group;
        mQualities = qualities;
    }

    /**
     * Getter of the group of the weapon
     *
     * @return the group of the weapon
     */
    public Group getGroup()
    {
        return mGroup;
    }

    /**
     * Getter of the qualities of the weapon
     *
     * @return the qualities of the weapon
     */
    public Qualities getQualities()
    {
        return mQualities;
    }

    /**
     * Indicates whether some other object is "equal to" this one.
     * @param object the reference object with which to compare.
     * @return true if this object is the same as the obj argument; false otherwise.
     */
    @Override
    public boolean equals(Object object)
    {
        if (object == null)
        {
            return false;
        }

        //Verify if it's not the same object
        if (object == this)
        {
            return true;
        }

        if (!(object instanceof Weapon))
        {
            return false;
        }

        Weapon other = (Weapon) object;

        return new EqualsBuilder()
                .appendSuper(super.equals(object))
                .append(mGroup, other.mGroup)
                .append(mQualities, other.mQualities)
                .isEquals();
    }

    /**
     * Returns a hash code value for the object.
     * @return a hash code value for this object.
     */
    @Override
    public int hashCode()
    {
        return new HashCodeBuilder(5, 19)
                .appendSuper(super.hashCode())
                .append(mGroup)
                .append(mQualities)
                .toHashCode();
    }
}
{'fraction_non_alphanumeric': 0.07238605898123325, 'fraction_numerical': 0.0014894250819183796, 'mean_word_length': 1.7054794520547945, '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': '2653250', 'n_tokens_mistral': 1902, 'n_tokens_neox': 1830, 'n_words': 590}