public class OperaArguments extends Object implements OperaArguments
| Modifier and Type | Field and Description |
|---|---|
protected List<OperaArgument> |
arguments |
static String |
DEFAULT_SIGN |
| Constructor and Description |
|---|
OperaArguments()
Provides a key/value storage of arguments related to the Opera product binary.
|
OperaArguments(String spaceDelimitedArguments)
Provide a space delimited list of arguments as a string that will be parsed and used as the
default values for this storage.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(OperaArgument argument)
Adds a new argument to the command-line argument list representation.
|
void |
add(String key)
Adds a new argument to the command-line argument list representation.
|
void |
add(String key,
Object value)
Adds a new argument with a value to the command-line argument list representation.
|
OperaArgument |
get(int index)
Convenience method to access the given indexed argument in the command-line list
representation.
|
List<OperaArgument> |
getArguments()
Gets the list of all arguments, each represented by
OperaArgument. |
List<String> |
getArgumentsAsStringList()
Gets all arguments as a string list, including the argument's values.
|
Iterator<OperaArgument> |
iterator()
Gets an iterator for all arguments present in this collection.
|
OperaArguments |
merge(OperaArguments extraArguments)
Merge this command-line list representation with another representation.
|
static OperaArguments |
parse(String string) |
void |
remove(OperaArgument argument)
Removes the specified argument from the command-line argument list representation.
|
String |
sign()
Gets the command-line argument sign used by this implementation of
OperaArguments. |
int |
size()
Fetches the number of arguments in the command-line list representation.
|
org.json.JSONObject |
toJson()
Converts this instance to its JSON representation.
|
String |
toString()
Gets the string representation of the command-line, as it would be used externally.
|
public static String DEFAULT_SIGN
protected List<OperaArgument> arguments
public OperaArguments()
public OperaArguments(String spaceDelimitedArguments)
spaceDelimitedArguments - list of arguments, as they would appear in a terminalpublic void add(String key)
OperaArgumentsOperaArgument will be created with an empty value.add in interface OperaArgumentskey - the argument key to addpublic void add(String key, Object value)
OperaArgumentsOperaArgument will be created with specified value.add in interface OperaArgumentskey - the argument key to addvalue - the value the argument should holdpublic void add(OperaArgument argument)
OperaArgumentsOperaArgument can optionally hold a value.add in interface OperaArgumentsargument - the argument to addpublic void remove(OperaArgument argument)
OperaArgumentsremove in interface OperaArgumentsargument - the argument to removepublic OperaArgument get(int index)
OperaArgumentsOperaArguments.getArguments().get(x).get in interface OperaArgumentsindex - the argument to fetchpublic List<OperaArgument> getArguments()
OperaArgumentsOperaArgument.getArguments in interface OperaArgumentspublic Iterator<OperaArgument> iterator()
OperaArgumentsiterator in interface OperaArgumentsiterator in interface Iterable<OperaArgument>public List<String> getArgumentsAsStringList()
OperaArgumentsgetArgumentsAsStringList in interface OperaArgumentspublic String toString()
OperaArgumentstoString in interface OperaArgumentstoString in class Objectpublic int size()
OperaArgumentsOperaArguments.getArguments().size().size in interface OperaArgumentspublic final OperaArguments merge(OperaArguments extraArguments)
OperaArgumentsOperaArguments
object.merge in interface OperaArgumentsextraArguments - the OperaArguments to merge into thispublic String sign()
OperaArgumentsOperaArguments.
Depending on which implementation (OperaCoreArguments,
OperaDesktopArguments) you are using, you will get a
OperaArgument.OperaArgumentSign.sign in interface OperaArgumentsOperaArgument.OperaArgumentSignpublic org.json.JSONObject toJson()
throws org.json.JSONException
org.json.JSONException - if an error occurs while encoding these settings as JSONpublic static OperaArguments parse(String string)
Copyright © 2012. All Rights Reserved.