/**
 * Copyright (C) 2010 the original author or authors.
 * See the notice.md file distributed with this work for additional
 * information regarding copyright ownership.
 *
 * 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 io.airlift.airline;

import java.util.Set;

import com.google.common.collect.ImmutableSet;

public class ParseOptionIllegalValueException extends ParseException
{
    private final String optionTitle, illegalValue;
    private final Set<String> allowedValues;

    ParseOptionIllegalValueException(String optionTitle, String value, Set<String> allowedValues)
    {
        super("Value for option '%s' was given as '%s' which is not in the list of allowed values: %s", optionTitle, value, allowedValues);
        this.optionTitle = optionTitle;
        this.illegalValue = value;
        this.allowedValues = ImmutableSet.copyOf(allowedValues);
    }

    public String getOptionTitle()
    {
        return optionTitle;
    }
    
    public String getIllegalValue()
    {
        return illegalValue;
    }
    
    public Set<String> getAllowedValues()
    {
        return allowedValues;
    }
}

@@ -832,78 +832,250 @@
 t;%0A%0A
-public class ParseOptionIllegalValueException extends ParseException%0A%7B
+/**%0A * Exception thrown when the value for an option is not in the list of allowed%0A * values%0A */%0Apublic class ParseOptionIllegalValueException extends ParseException %7B%0A    private static final long serialVersionUID = 810812151673279427L;%0A    
 %0A   
@@ -1266,20 +1266,16 @@
 dValues)
-%0A   
  %7B%0A     
@@ -1385,16 +1385,32 @@
 onTitle,
+%0A               
  value, 
@@ -1572,16 +1572,97 @@
 %0A    %7D%0A%0A
+    /**%0A     * Gets the option title%0A     * %0A     * @return Option title%0A     */%0A
     publ
@@ -1687,20 +1687,16 @@
 nTitle()
-%0A   
  %7B%0A     
@@ -1716,36 +1716,115 @@
 ionTitle;%0A    %7D%0A
+%0A
     
+/**%0A     * Gets the illegal value%0A     * %0A     * @return Illegal value%0A     */
 %0A    public Stri
@@ -1843,20 +1843,16 @@
 lValue()
-%0A   
  %7B%0A     
@@ -1881,20 +1881,108 @@
 ;%0A    %7D%0A
+%0A
     
+/**%0A     * Gets the set of allowed values%0A     * %0A     * @return Allowed values%0A     */
 %0A    pub
@@ -2015,20 +2015,16 @@
 Values()
-%0A   
  %7B%0A     

Add Javadoc to ParseOptionIllegalValueException