// Path: src/main/java/org/tyrannyofheaven/bukkit/util/ToHStringUtils.java
// public static boolean hasText(String text) {
//     return text != null && text.trim().length() > 0;
// }


import static org.tyrannyofheaven.bukkit.util.ToHStringUtils.hasText;
import java.util.Arrays;
/*
 * Copyright 2011 ZerothAngel <zerothangel@tyrannyofheaven.org>
 *
 * 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.tyrannyofheaven.bukkit.util.command;



/**
 * Metadata for mapped parameters.
 * 
 * @author zerothangel
 */
final class OptionMetaData implements MethodParameter {

    private static final String DEFAULT_VALUE_NAME = "value";

    private final String[] names;

    private final String valueName;

    private final Class<?> type;
    
    private final boolean optional;
    
    private final boolean nullable;
    
    private final String completer;

    /**
     * Create an OptionMetaData.
     * 
     * @param names the name of the mapping along with any aliases
     * @param type the parameter type
     * @param optional true if optional
     */
    public OptionMetaData(String[] names, String valueName, Class<?> type, boolean optional, boolean nullable, String completer) {
        if (names == null || names.length == 0)
            throw new IllegalArgumentException("names must be given");
// Path: src/main/java/org/tyrannyofheaven/bukkit/util/ToHStringUtils.java
// public static boolean hasText(String text) {
//     return text != null && text.trim().length() > 0;
// }


// Path: src/main/java/org/tyrannyofheaven/bukkit/util/command/OptionMetaData.java
import static org.tyrannyofheaven.bukkit.util.ToHStringUtils.hasText;
import java.util.Arrays;

/*
 * Copyright 2011 ZerothAngel <zerothangel@tyrannyofheaven.org>
 *
 * 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.tyrannyofheaven.bukkit.util.command;



/**
 * Metadata for mapped parameters.
 * 
 * @author zerothangel
 */
final class OptionMetaData implements MethodParameter {

    private static final String DEFAULT_VALUE_NAME = "value";

    private final String[] names;

    private final String valueName;

    private final Class<?> type;
    
    private final boolean optional;
    
    private final boolean nullable;
    
    private final String completer;

    /**
     * Create an OptionMetaData.
     * 
     * @param names the name of the mapping along with any aliases
     * @param type the parameter type
     * @param optional true if optional
     */
    public OptionMetaData(String[] names, String valueName, Class<?> type, boolean optional, boolean nullable, String completer) {
        if (names == null || names.length == 0)
            throw new IllegalArgumentException("names must be given");
        if (!hasText(valueName))