/* This file is part of SableCC ( http://sablecc.org ).
 *
 * See the NOTICE file distributed with this work for copyright information.
 *
 * 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 org.sablecc.sablecc.launcher;

import org.sablecc.sablecc.exception.InternalException;

public class OptionArgument {

    private Option option;

    private String operand;

    public OptionArgument(
            Option option,
            String operand) {

        if (option == null) {
            throw new InternalException("option may not be null");
        }

        this.option = option;
        this.operand = operand;
    }

    public Option getOption() {

        return this.option;
    }

    public String getOperand() {

        return this.operand;
    }
}

/* This file is part of SableCC ( http://sablecc.org ).
 *
 * See the NOTICE file distributed with this work for copyright information.
 *
 * 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 org.sablecc.sablecc.launcher;

import org.sablecc.sablecc.exception.InternalException;

/**
 * An option argument is composed of the option and its operand.
 */
public class OptionArgument {

    /** The option for this option argument. */
    private Option option;

    /** The operand for this option argument. */
    private String operand;

    /**
     * Constructs an option argument with the provided option and operand.
     * 
     * @param option
     *            the option.
     * @param operand
     *            the operand.
     * @throws InternalException
     *             if the provided option is <code>null</code>.
     */
    public OptionArgument(
            Option option,
            String operand) {

        if (option == null) {
            throw new InternalException("option may not be null");
        }

        this.option = option;
        this.operand = operand;
    }

    /**
     * Returns the option of this option argument.
     * 
     * @return the option.
     */
    public Option getOption() {

        return this.option;
    }

    /**
     * Returns the operand of this option argument.
     * 
     * @return the argument.
     */
    public String getOperand() {

        return this.operand;
    }
}

Add javadoc comments. See ticket:58.
Add javadoc comments. See ticket:58.

Signed-off-by: Patrick Pelletier <4307fca26d0353058fbfb17dc5f40867e5e6b8e6@gmail.com>
Signed-off-by: Etienne M. Gagnon <bf06ec0eb40152cd863534753d026b021022c851@j-meg.com>
