All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.robovm.compiler.plugin.PluginArguments Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) 2014 RoboVM AB
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see .
 */
package org.robovm.compiler.plugin;

import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;

/**
 * Stores the {@link PluginArgument} along with the prefix to be used
 * for the arguments.
 */
public class PluginArguments {
    private final String prefix;
    private final List arguments;
    private final Set lookup;

    public PluginArguments(String prefix, List arguments) {
        this.prefix = Objects.requireNonNull(prefix, "Prefix must not be null");
        this.arguments = Objects.requireNonNull(arguments, "arguments must not be null");
        this.lookup = new HashSet<>();
        for(PluginArgument arg: arguments) {
            lookup.add(arg.getName());
        }
    }

    public String getPrefix() {
        return prefix;
    }

    public List getArguments() {
        return arguments;
    }
    
    public boolean hasArgument(String argWithPrefix) {
        return lookup.contains(argWithPrefix);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy