/*
 * @(#)Argument.java
 *
 * Copyright (c) 2002-2003 JSCAPE
 * 1147 S. 53rd Pl., Mesa, Arizona, 85206, U.S.A.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * JSCAPE. ("Confidential Information").  You shall not disclose such
 * Confidential Information and shall use it only in accordance with
 * the terms of the license agreement you entered into with JSCAPE.
 */

package com.jscape.util.cli.ext;

import static com.jscape.util.Parameters.assertNotNull;

/**
 * Message line argument.
 *
 * @author Alex
 */
public class Argument {

    private final String value;
    private boolean parsed;

    /**
     * Creates a new parameter instance.
     *
     * @param value parameter value
     */
    public Argument(String value) {
        assertNotNull(value);
        this.value = value;

        this.parsed = false;
    }

    /**
     * Returns an argument's value.
     *
     * @return an argument's value
     */
    public String value() {
        return this.value;
    }

    /**
     * Returns argument parsed flag.
     *
     * @return <code>true</code> if argument is marked as parsed
     */
    public boolean parsed() {
        return this.parsed;
    }

    /**
     * Sets argument parsed.
     */
    public void setParsed() {
        this.parsed = true;
    }

    @Override
    public String toString() {
        return "Argument {"
                + "value='" + this.value + '\''
                + ", parsed=" + this.parsed
                + '}';
    }
}
