Class ParserParameters
java.lang.Object
cloud.commandframework.arguments.parser.ParserParameters
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull ParserParameters
empty()
Get an emptyParserParameters
instance<T> @NonNull T
get
(@NonNull ParserParameter<T> parameter, @NonNull T defaultValue) Get a value from the parameter map, if it is stored, else return a default value@NonNull Map<@NonNull ParserParameter<?>,
@NonNull Object> getAll()
Get an immutable view of the internal map<T> boolean
has
(@NonNull ParserParameter<T> parameter) Check if this instance contains a parameter-object pair for a given parametervoid
merge
(@NonNull ParserParameters other) Attempt to merge twoParserParameters
instances.static <T> @NonNull ParserParameters
single
(@NonNull ParserParameter<T> parameter, @NonNull T value) Create aParserParameters
instance containing a single key-value par<T> void
store
(@NonNull ParserParameter<T> parameter, @NonNull T value) Store a parameter-object pair
-
Constructor Details
-
ParserParameters
public ParserParameters()
-
-
Method Details
-
empty
Get an emptyParserParameters
instance- Returns:
- Empty instance
-
single
public static <T> @NonNull ParserParameters single(@NonNull ParserParameter<T> parameter, @NonNull T value) Create aParserParameters
instance containing a single key-value par- Type Parameters:
T
- Value type- Parameters:
parameter
- Parametervalue
- Value- Returns:
- Constructed instance
-
has
Check if this instance contains a parameter-object pair for a given parameter- Type Parameters:
T
- Parameter type- Parameters:
parameter
- Parameter- Returns:
true
if such a pair is stored, elsefalse
-
store
Store a parameter-object pair- Type Parameters:
T
- Parameter type- Parameters:
parameter
- Parametervalue
- Object
-
get
Get a value from the parameter map, if it is stored, else return a default value- Type Parameters:
T
- Parameter type- Parameters:
parameter
- Parameter to retrievedefaultValue
- Default value- Returns:
- Parameter value
-
merge
Attempt to merge twoParserParameters
instances. If the instances contain conflicting values, the values of the "other" instance will be preferred- Parameters:
other
- Other instance
-
getAll
Get an immutable view of the internal map- Returns:
- Immutable map
-