<commit_before>/*
 * PackList is an open-source packing-list for Android
 *
 * Copyright (c) 2016 <NAME>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package com.nbossard.packlist.model;

/*
@startuml
    class com.nbossard.packlist.model.Item {
        UUID mUUID
        String mName
        boolean mIsPacked
    }
@enduml
 */

import java.io.Serializable;
import java.util.UUID;

/**
 * An item to take in a trip.
 * @author Created by nbossard on 17/01/16.
 */
public class Item implements Serializable, Cloneable {

// *********************** FIELDS *************************************************************************

    /** A unique identifier for this item. */
    private UUID mUUID;

    /** The item name. */
    private String mName;

    /** Has this item been packed already. true=yes, false=no. */
    private boolean mIsPacked;

// *********************** METHODS **************************************************************************

    /**
     * No params constructor.
     */
    private Item() {
        mUUID = UUID.randomUUID();
    }

    /**
     * Full params constructor.
     *
     * @param parName new item name. i.e. : "socks"
     */
    public Item(final String parName) {
        this();
        setName(parName);
    }

    /**
     * @return automatically set UUID (unique identifier)
     */
    public final UUID getUUID() {
        return mUUID;
    }

    /**
     * Getter for name.
     * @return i.e. : "Socks"
     */
    public final String getName() {
        return mName;
    }

    /**
     * Setter for name/ destination of item.
     * @param parName trip name, usually destination. i.e. : "Dublin"
     */
    @SuppressWarnings("WeakerAccess")
    public final void setName(final String parName) {
        mName = parName;
    }

    /**
     * Getter for boolean whether or not this item is packed.
     * @return true=yes, false=no.
     */
    public final boolean isPacked() {
        return mIsPacked;
    }

    /**
     * Setter for  whether or not this item is packed.
     * @param parPacked true=yes, false=no.
     */
    public final void setPacked(final boolean parPacked) {
        mIsPacked = parPacked;
    }

    @Override
    protected final Item clone() throws CloneNotSupportedException {
        Item res = (Item) super.clone();

        // setting another UUID for the clone
        res.mUUID = UUID.randomUUID();

        return res;
    }

    @SuppressWarnings("StringBufferReplaceableByString")
    @Override
    public final String toString() {
        final StringBuilder sb = new StringBuilder("Item{");
        sb.append("mUUID=").append(mUUID);
        sb.append(", mName='").append(mName).append('\'');
        sb.append(", mIsPacked='").append(mIsPacked).append('\'');
        sb.append('}');
        return sb.toString();
    }
}<commit_msg>Adding weight in item object<commit_after>/*
 * PackList is an open-source packing-list for Android
 *
 * Copyright (c) 2016 <NAME>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package com.nbossard.packlist.model;

/*
@startuml
    class com.nbossard.packlist.model.Item {
        UUID mUUID
        String mName
        boolean mIsPacked
    }
@enduml
 */

import java.io.Serializable;
import java.util.UUID;

/**
 * An item to take in a trip.
 * @author Created by nbossard on 17/01/16.
 */
public class Item implements Serializable, Cloneable {

// *********************** FIELDS *************************************************************************

    /** A unique identifier for this item. */
    private UUID mUUID;

    /** The item name. */
    private String mName;

    /** The item weight. */
    private int mWeight;

    /** Has this item been packed already. true=yes, false=no. */
    private boolean mIsPacked;

// *********************** METHODS **************************************************************************

    /**
     * No params constructor.
     */
    private Item() {
        mUUID = UUID.randomUUID();
    }

    /**
     * Full params constructor.
     *
     * @param parName new item name. i.e. : "socks"
     */
    public Item(final String parName) {
        this();
        setName(parName);
    }

    /**
     * @return automatically set UUID (unique identifier)
     */
    public final UUID getUUID() {
        return mUUID;
    }

    /**
     * Getter for name.
     * @return i.e. : "Socks"
     */
    public final String getName() {
        return mName;
    }

    /**
     * Setter for name/ destination of item.
     * @param parName trip name, usually destination. i.e. : "Dublin"
     */
    @SuppressWarnings("WeakerAccess")
    public final void setName(final String parName) {
        mName = parName;
    }


    /**
     * Getter for weight.
     * @return i.e. : "100" grammes
     */
    public final int getWeight() {
        return mWeight;
    }

    /**
     * Setter for weight.
     * @param parWeight item weight in grammes.
     */
    @SuppressWarnings("WeakerAccess")
    public final void setName(final int parWeight) {
        mWeight = parWeight;
    }

    /**
     * Getter for boolean whether or not this item is packed.
     * @return true=yes, false=no.
     */
    public final boolean isPacked() {
        return mIsPacked;
    }

    /**
     * Setter for  whether or not this item is packed.
     * @param parPacked true=yes, false=no.
     */
    public final void setPacked(final boolean parPacked) {
        mIsPacked = parPacked;
    }

    @Override
    protected final Item clone() throws CloneNotSupportedException {
        Item res = (Item) super.clone();

        // setting another UUID for the clone
        res.mUUID = UUID.randomUUID();

        return res;
    }

    @SuppressWarnings("StringBufferReplaceableByString")
    @Override
    public final String toString() {
        final StringBuilder sb = new StringBuilder("Item{");
        sb.append("mUUID=").append(mUUID);
        sb.append(", mName='").append(mName).append('\'');
        sb.append(", mWeight='").append(mWeight).append('\'');
        sb.append(", mIsPacked='").append(mIsPacked).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
{'fraction_non_alphanumeric': 0.16154059296203935, 'fraction_numerical': 0.0042948185092823495, 'mean_word_length': 2.4673390970220943, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1885448', 'n_tokens_mistral': 2097, 'n_tokens_neox': 2059, 'n_words': 649}