public class ListArg<V,T extends CommandArg<V>> extends Object implements CommandArg<List<V>>, MatchingArg<V>, SenderArg<List<V>>, SenderMatchingArg<V>, Iterable<T>
Constructor and Description |
---|
ListArg(String separator,
CommandArgFactory<T> factory,
String string) |
Modifier and Type | Method and Description |
---|---|
Iterator<T> |
iterator() |
List<V> |
match()
Returns all values which match the argument.
|
List<V> |
matchOr(CommandSender sender)
Returns all values which match the argument or
the given CommandSender if argument is omitted.
|
List<V> |
matchOr(List<V> def)
Returns all values which match the argument or
the given default list if the argument is omitted.
|
List<V> |
matchOr(V def)
Returns all values which match the argument or
a list containing the given default if argument
is omitted.
|
List<V> |
matchWithPermOr(String permission,
CommandSender sender)
Same as
SenderMatchingArg.matchOr(CommandSender)
but also check the given permission if
the argument is specified. |
List<V> |
value()
Returns the parsed value.
|
List<V> |
valueOr(CommandSender sender)
Returns the parsed value or compute it from
the given CommandSender if argument is omitted.
|
List<V> |
valueOr(List<V> def)
Returns the parsed value or the given default if the
argument is omitted.
|
List<V> |
valueOrSingleton(V def) |
List<V> |
valueWithPermOr(String permission,
CommandSender sender)
Same as
SenderArg.valueOr(CommandSender)
but also check the given permission if
the argument is specified. |
public ListArg(String separator, CommandArgFactory<T> factory, String string)
public List<V> value()
CommandArg
value
in interface CommandArg<List<V>>
public List<V> valueOrSingleton(V def)
public List<V> valueOr(List<V> def)
CommandArg
valueOr
in interface CommandArg<List<V>>
public List<V> valueOr(CommandSender sender)
CommandArg
type argument of
this ListArg must implement SenderArg
or
this will throws an UnsupportedOperationException.valueOr
in interface SenderArg<List<V>>
UnsupportedOperationException
public List<V> valueWithPermOr(String permission, CommandSender sender)
SenderArg.valueOr(CommandSender)
but also check the given permission if
the argument is specified.
Note that the CommandArg
type argument of
this ListArg must implement SenderArg
or
this will throws an UnsupportedOperationException.valueWithPermOr
in interface SenderArg<List<V>>
UnsupportedOperationException
public List<V> match()
CommandArg
type argument of
this ListArg must implement MatchingArg
or
this will throws an UnsupportedOperationException.match
in interface MatchingArg<V>
UnsupportedOperationException
public List<V> matchOr(V def)
CommandArg
type argument of
this ListArg must implement MatchingArg
or
this will throws an UnsupportedOperationException.matchOr
in interface MatchingArg<V>
UnsupportedOperationException
public List<V> matchOr(List<V> def)
CommandArg
type argument of
this ListArg must implement MatchingArg
or
this will throws an UnsupportedOperationException.matchOr
in interface MatchingArg<V>
UnsupportedOperationException
public List<V> matchOr(CommandSender sender)
CommandArg
type argument of
this ListArg must implement SenderMatchingArg
or this will throws an UnsupportedOperationException.matchOr
in interface SenderMatchingArg<V>
UnsupportedOperationException
public List<V> matchWithPermOr(String permission, CommandSender sender)
SenderMatchingArg.matchOr(CommandSender)
but also check the given permission if
the argument is specified.
Note that the CommandArg
type argument of
this ListArg must implement SenderMatchingArg
or this will throws an UnsupportedOperationException.matchWithPermOr
in interface SenderMatchingArg<V>
UnsupportedOperationException
Copyright © 2012. All Rights Reserved.