
de.saumya.mojo.ruby.script.Arguments Maven / Gradle / Ivy
/**
*
*/
package de.saumya.mojo.ruby.script;
import java.util.LinkedList;
import java.util.List;
class Arguments {
final List list = new LinkedList();
Arguments add(final String name) {
if (name != null) {
this.list.add(name);
}
return this;
}
Arguments add(final String name, final String value) {
this.list.add(name);
this.list.add(value);
return this;
}
Arguments parseAndAdd(final String line) {
if (line != null) {
for (final String arg : line.trim().split("\\s+")) {
this.list.add(arg);
}
}
return this;
}
boolean matches(final String regex) {
boolean matches = false;
for (String arg : list) {
if (arg.matches(regex)) {
matches = true;
break;
}
}
return matches;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy